Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pkg.build errors #48

Closed
yuzhangbit opened this issue Apr 30, 2017 · 19 comments · Fixed by #92
Closed

Pkg.build errors #48

yuzhangbit opened this issue Apr 30, 2017 · 19 comments · Fixed by #92

Comments

@yuzhangbit
Copy link

yuzhangbit commented Apr 30, 2017

OS: ubuntu 16.04
Julia version: 0.5.1

When I run

Pkg.add("Cbc")
Pkg.build("Cbc")

I get the error output below:

make[4]: Entering directory '/home/robot/.julia/v0.5/Cbc/deps/src/Cbc-2.9.8/Osi'
PKG_CONFIG_PATH=/home/robot/.julia/v0.5/Cbc/deps/usr/lib64/pkgconfig:/home/robot/.julia/v0.5/Cbc/deps/usr/lib/pkgconfig:/home/robot/.julia/v0.5/Cbc/deps/usr/share/pkgconfig:/home/robot/catkin_ws/devel/lib/pkgconfig:/opt/ros/kinetic/lib/pkgconfig:/opt/ros/kinetic/lib/x86_64-linux-gnu/pkgconfig:/home/robot/.julia/v0.5/Cbc/deps/usr/lib/pkgconfig \
pkg-config --libs osi > /home/robot/.julia/v0.5/Cbc/deps/usr/share/coin/doc/Osi/osi_addlibs.txt
make[4]: Leaving directory '/home/robot/.julia/v0.5/Cbc/deps/src/Cbc-2.9.8/Osi'
make[3]: Leaving directory '/home/robot/.julia/v0.5/Cbc/deps/src/Cbc-2.9.8/Osi'
make[2]: Leaving directory '/home/robot/.julia/v0.5/Cbc/deps/src/Cbc-2.9.8/Osi'
make[1]: Leaving directory '/home/robot/.julia/v0.5/Cbc/deps/src/Cbc-2.9.8/Osi'
Making install in Clp
make[1]: Entering directory '/home/robot/.julia/v0.5/Cbc/deps/src/Cbc-2.9.8/Clp'
Making install in src
make[2]: Entering directory '/home/robot/.julia/v0.5/Cbc/deps/src/Cbc-2.9.8/Clp/src'
if /bin/bash ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I`echo .`  -I/usr/local/include/coin/ThirdParty -DCOIN_USE_MUMPS_MPI_H -I/usr/local/include/coin/ThirdParty -I/home/robot/.julia/v0.5/Cbc/deps/src/Cbc-2.9.8/CoinUtils/src  -DCOIN_HAS_CLP     -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long   -DCLP_BUILD -MT ClpCholeskyMumps.lo -MD -MP -MF ".deps/ClpCholeskyMumps.Tpo" -c -o ClpCholeskyMumps.lo ClpCholeskyMumps.cpp; \
then mv -f ".deps/ClpCholeskyMumps.Tpo" ".deps/ClpCholeskyMumps.Plo"; else rm -f ".deps/ClpCholeskyMumps.Tpo"; exit 1; fi
 g++ -DHAVE_CONFIG_H -I. -I. -I/usr/local/include/coin/ThirdParty -DCOIN_USE_MUMPS_MPI_H -I/usr/local/include/coin/ThirdParty -I/home/robot/.julia/v0.5/Cbc/deps/src/Cbc-2.9.8/CoinUtils/src -DCOIN_HAS_CLP -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long -DCLP_BUILD -MT ClpCholeskyMumps.lo -MD -MP -MF .deps/ClpCholeskyMumps.Tpo -c ClpCholeskyMumps.cpp  -fPIC -DPIC -o .libs/ClpCholeskyMumps.o
ClpCholeskyMumps.cpp:17:17: fatal error: mpi.h: No such file or directory
compilation terminated.
Makefile:931: recipe for target 'ClpCholeskyMumps.lo' failed
make[2]: *** [ClpCholeskyMumps.lo] Error 1
make[2]: Leaving directory '/home/robot/.julia/v0.5/Cbc/deps/src/Cbc-2.9.8/Clp/src'
Makefile:519: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/home/robot/.julia/v0.5/Cbc/deps/src/Cbc-2.9.8/Clp'
Makefile:323: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
===========================================[ ERROR: Cbc ]===========================================

LoadError: failed process: Process(`make install`, ProcessExited(2)) [2]
while loading /home/robot/.julia/v0.5/Cbc/deps/build.jl, in expression starting on line 62

====================================================================================================

@blegat
Copy link
Member

blegat commented Apr 30, 2017

It seems you are missing MPI headers, could you try doing

$ sudo apt-get install mpi-default-dev
$ julia -e 'Pkg.build("Cbc")'

and tell us if it worked ?

@yuzhangbit
Copy link
Author

@blegat Thanks for your quick reply. I tried your method. The same error still happens.

@blegat
Copy link
Member

blegat commented Apr 30, 2017

Did the installation work ? It should have also installed libopenmpi-dev as a dependency which has installed a file mpi.h at /usr/lib/openmpi/include/mpi.h.
Can you check that it is indeed there with e.g. $ ls /usr/lib/openmpi/include/mpi.h ?

@mlubin
Copy link
Member

mlubin commented Apr 30, 2017

It's probably finding a version of Mumps that requires MPI. If you don't need this, reinstall a version of Mumps that doesn't link against MPI.

@yuzhangbit
Copy link
Author

yuzhangbit commented Apr 30, 2017

@blegat The installation worked. But I still get the same error when installing Cbc in Julia.
If I run ls /usr/lib/openmpi/include/mpi.h, the output is

/usr/lib/openmpi/include/mpi.h

@mlubin I do need Mumps for other optimization solvers. If I install Cbc from source in C++, the installation(C++ version) works fine. So I assume something is wrong with the julia Cbc deps build script.

@mlubin
Copy link
Member

mlubin commented Apr 30, 2017

@yuzhangbit, the entire build script is here.

@yuzhangbit
Copy link
Author

@mlubin Thanks for your information.

@blegat
Copy link
Member

blegat commented Apr 30, 2017

It seems that the issue is that mpi.h is not in /usr/lib/openmpi/include is scanned for by g++ when looking for the header. You can see where it looks for by running

$ cpp -v /dev/null -o /dev/null

If you add -I /usr/lib/openmpi/include to the g++ line that is failing, it should find mpi.h.
However, it is weird that you should do that since normally when you install a -dev package with apt-get, you should have to use -I... Have you tried to close your terminal and start a new one ?

@yuzhangbit
Copy link
Author

Still can't resolve it.

@blegat
Copy link
Member

blegat commented Apr 30, 2017

You can try

$ ln -s /usr/lib/openmpi/include/mpi.h /usr/include

even if it's just a hack

@mlubin
Copy link
Member

mlubin commented Apr 30, 2017

If I install Cbc from source in C++, the installation(C++ version) works fine. So I assume something is wrong with the julia Cbc deps build script.

@yuzhangbit, can you reproduce the issue by building from source and using the Cbc.jl script that I pointed to?

@yuzhangbit
Copy link
Author

@mlubin Yes. By building Julia 0.5.1 from source and using the Cbc.jl, I can recreate the issue.

@mlubin
Copy link
Member

mlubin commented May 1, 2017

@yuzhangbit, I meant building Cbc from source independent of Julia, as you said you had done before.

@yuzhangbit
Copy link
Author

@blegat Thanks for your information. I tried. It's not just 'mpi.h' file. If I hacked it in this way, the compiling asks for other mpi header files as well. It's the whole mpi include directory that is not passed to the build script.

@blegat
Copy link
Member

blegat commented May 1, 2017

Then do

$ ln -s /usr/lib/openmpi/include /usr/include/openmpi

@mlubin
Copy link
Member

mlubin commented May 1, 2017

The ubuntu cbc package coinor-libcbc-dev might also work. Just install it then run Pkg.build("Cbc").

@yuzhangbit
Copy link
Author

@mlubin Cool! Thanks a lot. The coinor-libcbc-dev solves the problem.

@blegat
Copy link
Member

blegat commented May 1, 2017

@yuzhangbit glad to hear this. If you have the time, it would help us to know what is in the build script that makes Cbc not compile while when you compile it by hands it works.

@yuzhangbit
Copy link
Author

yuzhangbit commented May 1, 2017

@blegat Sure thing. It's the Clp/src build script under the Cbc-2.9.8 folder that can not find the include directory for the mpi. I also notice that the Cbc build script doesn't follow exactly the instruction from the Cbc website. The

BuildTools/get.dependencies fetch

part is missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants