Unable to find libigraph.so, libigraph.a or igraph.dll files in package

Hi,

I am new to igraph. I am trying to install it in MacOS M1chip using Visual Studio Code. I am unable to find libigraph.so , libigraph.a or igraph.dll files in the package. Could some one please help me in how to locate these files and in installation process. Sorry If I am asking for too much.

You can compile the igraph C library yourself, according to the instructions in the documentation:

https://igraph.org/c/

igraph is also available in MacPorts and Homebrew, which will save you the trouble of compilation. But if you are going to be working with igraph from C, I strongly suggest you compile it yourself, using the specific options you need.

Visual Studio Code is a text editor. It plays no role in installing igraph, and has no bearing on how you would install igraph.

Thank you for the reply.

I followed these steps:

  1. Installed cmake
  2. Downloaded the igraph source code.
  3. Launched Cmake, for the label ‘Where is the source code’, I provided the igraph folder (which is extracted from the igraph source code .tar file)
  4. And for ‘Where to build libraries’, I created a new folder named Build in igraph folder, and provided its path.
  5. I clicked on configure and then generate, both went successfully.
  6. Then I tried testing it with igraph_test.c given in tutorial. Which landed me with the question I asked above.

Am I doing it right way or wrong? I am totally confused.

Please follow the instruction to the end. You did not compile the package. See the last step:

https://igraph.org/c/doc/igraph-Installation.html#igraph-Installation-general-build-instructions

I strongly suggest that you use cmake from the command line. Use the GUI only for adjusting configuration. Even for that, ccmake is easier to use than cmake-gui.

I tried to follow your instructions. I am getting the following error. Could you please let me know the reason for this and how to rectify it.

(base) ranbir@x86_64-apple-darwin13 downloads % cd igraph
(base) ranbir@x86_64-apple-darwin13 igraph % mkdir build
(base) ranbir@x86_64-apple-darwin13 igraph % cd build
(base) ranbir@x86_64-apple-darwin13 build % cmake …
– Setting build type to ‘Release’ as none was specified.
– Version number: 0.9.1
– The C compiler identification is Clang 10.0.1
– The CXX compiler identification is Clang 10.0.1
– Detecting C compiler ABI info
– Detecting C compiler ABI info - failed
– Check for working C compiler: /Users/ranbir/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang
– Check for working C compiler: /Users/ranbir/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang - broken
CMake Error at /opt/homebrew/Cellar/cmake/3.19.6/share/cmake/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler

"/Users/ranbir/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /Users/ranbir/downloads/igraph/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_e1ac4/fast && /Library/Developer/CommandLineTools/usr/bin/make  -f CMakeFiles/cmTC_e1ac4.dir/build.make CMakeFiles/cmTC_e1ac4.dir/build
Building C object CMakeFiles/cmTC_e1ac4.dir/testCCompiler.c.o
/Users/ranbir/opt/anaconda3/bin/x86_64-apple-darwin13.4.0-clang   -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/ranbir/opt/anaconda3/include  -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o CMakeFiles/cmTC_e1ac4.dir/testCCompiler.c.o -c /Users/ranbir/downloads/igraph/build/CMakeFiles/CMakeTmp/testCCompiler.c
clang-10: error: the clang compiler does not support '-march=core2'
make[1]: *** [CMakeFiles/cmTC_e1ac4.dir/testCCompiler.c.o] Error 1
make: *** [cmTC_e1ac4/fast] Error 2

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:31 (project)

– Configuring incomplete, errors occurred!
See also “/Users/ranbir/downloads/igraph/build/CMakeFiles/CMakeOutput.log”.
See also “/Users/ranbir/downloads/igraph/build/CMakeFiles/CMakeError.log”.

Remove Anaconda from your path.

Use Apple’s supported compiler: install Xcode and its command line tools.