snopt / snopt-python

MIT License
42 stars 13 forks source link

Installation is not working #1

Closed Rlahuerta closed 8 years ago

Rlahuerta commented 8 years ago

Dear all,

I am trying to install it, but is not working. I am using Ubuntu 14.04 LTS, I change the SNOPT variable as: export SNOPT7=$HOME/snopt-python/snopt7

and then sudo python setup.py build sudo python setup.py install --user

and looks like that process did not find the correct path of the installation:

/usr/bin/ld: cannot find -lsnopt7 collect2: error: ld returned 1 exit status error: Command "/usr/bin/gfortran -Wall -Wall -shared build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/snopt7/snopt7_pythonmodule.o build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/fortranobject.o build/temp.linux-x86_64-2.7/snopt7/snopt7_python.o -L/home/rdoll/lib -lsnopt7 -lgfortran -o build/lib.linux-x86_64-2.7/optimize/snopt7/snopt7_python.so" failed with exit status 1

Any idea?

Best Regards

gnowzil commented 8 years ago

Can you double check the location of the snopt library? Also check you've set the env variable correctly. Right now you've listed SNOPT7 as $HOME/snopt-python/snopt7, but in the executed code, it's /home/rdoll/lib.

gnowzil commented 8 years ago

I'm closing this, assuming the problem has been fixed. Submit again if you're still having issues.

aespielberg commented 6 years ago

I am having the same problem. It is not clear what is meant in the README by the snopt7 library. Do you mean the entire folder, the compiled .so files, just the fortran files, or something else entirely?

gnowzil commented 6 years ago

The library as in the compiled library -- on Linux, the .so shared object library or the .a static library.

GrauleM commented 5 years ago

I am facing a similar issue (please see details below). Please let me know what additional info would be helpful. Thanks a lot for your help!


I get the following error when running 'sudo python setup.py build':

usr/bin/ld: cannot find -lsnopt7 collect2: error: ld returned 1 exit status /usr/bin/ld: cannot find -lsnopt7 collect2: error: ld returned 1 exit status error: Command "/usr/bin/gfortran -Wall -g -Wall -g -shared build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/solvers/f2py/snopt7_pythonmodule.o build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/build/src.linux-x86_64-2.7/solvers/f2py/fortranobject.o build/temp.linux-x86_64-2.7/solvers/f2py/snopt7_python.o -L/usr/local/lib -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5 -lsnopt7 -lgfortran -o build/lib.linux-x86_64-2.7/optimize/solvers/snopt7_python.so" failed with exit status 1


content of my folder '/usr/local/lib': libf2c libf2c.a libsnopt_c.so libsnopt_c.so.7 libsnopt_c.so.7.2.12 pkgconfig python2.7 python3.5 snopt snopt-python

gnowzil commented 5 years ago

where's libsnopt7?

GrauleM commented 5 years ago

Thanks for the fast reply! I noticed 'libsnopt7.so' was not in there, but wasn't sure whether I should have both 'libsnopt7.so' and 'libsnopt7_c.so' in this folder.

I may be doing something wrong when installing. Below is the output after 'sudo make install':

[ 0%] Built target arithchk [ 78%] Built target f2c [ 98%] Built target snopt_c [100%] Built target csntoya Install the project... -- Install configuration: "Release" -- Up-to-date: /usr/local/lib/snopt/cmake/snopt-config.cmake -- Up-to-date: /usr/local/lib/snopt/cmake/snopt-config-version.cmake -- Up-to-date: /usr/local/lib/libf2c.a -- Up-to-date: /usr/local/include/libf2c/f2c.h -- Up-to-date: /usr/local/lib/libf2c/cmake/libf2c-targets.cmake -- Up-to-date: /usr/local/lib/libf2c/cmake/libf2c-targets-release.cmake -- Up-to-date: /usr/local/lib/libf2c/cmake/libf2c-config.cmake -- Up-to-date: /usr/local/lib/libf2c/cmake/libf2c-config-version.cmake -- Up-to-date: /usr/local/lib/pkgconfig/libf2c.pc -- Up-to-date: /usr/local/share/doc/libf2c/LICENSE -- Up-to-date: /usr/local/lib/libsnopt_c.so.7.2.12 -- Up-to-date: /usr/local/lib/libsnopt_c.so.7 -- Up-to-date: /usr/local/lib/libsnopt_c.so -- Up-to-date: /usr/local/include/snopt/snfilewrapper.hh -- Up-to-date: /usr/local/include/snopt/snopt.hh -- Up-to-date: /usr/local/lib/snopt/cmake/snopt_c-targets.cmake -- Up-to-date: /usr/local/lib/snopt/cmake/snopt_c-targets-release.cmake -- Up-to-date: /usr/local/lib/pkgconfig/snopt_c.pc

gnowzil commented 5 years ago

What package are you using? We don't use cmake. I can only help if it's an "official" snopt package.

GrauleM commented 5 years ago

Thanks again for getting back so quickly; I emailed you directly with additional details.