bayerj / arac

C++ library for neural networks.
Other
39 stars 57 forks source link

build error on Cygwin #12

Open BAM-BAM-BAM opened 13 years ago

BAM-BAM-BAM commented 13 years ago

I'm trying to build arac on cygwin/Window 7 64-bit.

This is the error I eventually get when using scons:

g++ -o test-arac.exe src/cpp/tests/test_datasets.o src/cpp/tests/test_main.o src/cpp/tests/test_optimzation.o src/cpp/tests/test_structure.o src/cpp/tests/test_utilities.o -L/usr/lib -L. -L/usr/local/lib -L/sw/lib -larac -lgtest
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -larac
collect2: ld returned 1 exit status
scons: *** [test-arac.exe] Error 1
scons: building terminated because of errors.

... so g++ can't find the arac library ... and I can't either.

Here are the lines in the SConstruct that are asking for the arac library:

testenv = Environment(LIBS=['arac', 'gtest'], CPPPATH=CPPPATH, LIBPATH=LIBPATH)
test = testenv.Program('test-arac', Glob('src/cpp/tests/*.cpp'))

libarac.so is successfully being generated earlier in the build process.

any ideas on how to get around this problem?

thanks!

BAM-BAM-BAM commented 13 years ago

I renamed libarac.so to libarac.dll it helped g++ find the library, but I guess the library exports aren't working.

$ g++ -o src/python/arac/_cppbridge.so -shared src/swig/cppbridge_wrap.os -L/usr/lib -L. -L/usr/local/lib -L/sw/lib -larac
src/swig/cppbridge_wrap.os:cppbridge_wrap.cc:(.text+0x9db): undefined reference to `_PyString_AsString'
src/swig/cppbridge_wrap.os:cppbridge_wrap.cc:(.text+0x9ee): undefined reference to `_PyString_FromString'
src/swig/cppbridge_wrap.os:cppbridge_wrap.cc:(.text+0xa1a): undefined reference to `__imp__PyExc_MemoryError'
 ... many more undefined references ...
BAM-BAM-BAM commented 13 years ago

fixed the undefined reference errors by adding python2.6 as a lib dependency in my local SConstruct file; not sure if it's a problem with my environment or not otherwise I would change the project's file.

bayerj commented 13 years ago

You have to make sure that libarac.so is found. For that, it needs to either be in /usr/local/lib or /sw/lib -- see the -L options in the g++ line.

I recommend you do that by creating a symbolic link. See the 2nd point at https://github.com/bayerj/arac/wiki/Installation.

On 11 September 2011 23:48, BAM-BAM-BAM reply@reply.github.com wrote:

I'm trying to build arac on cygwin/Window 7 64-bit.

This is the error I eventually get when using scons:

   g++ -o test-arac.exe src/cpp/tests/test_datasets.o src/cpp/tests/test_main.o src/cpp/tests/test_optimzation.o src/cpp/tests/test_structure.o src/cpp/tests/test_utilities.o -L/usr/lib -L. -L/usr/local/lib -L/sw/lib -larac -lgtest    /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -larac    collect2: ld returned 1 exit status    scons: *\ [test-arac.exe] Error 1    scons: building terminated because of errors.

... so g++ can't find the arac library ... and I can't either.

Here are the lines in the SConstruct that are asking for the arac library:

   testenv = Environment(LIBS=['arac', 'gtest'], CPPPATH=CPPPATH, LIBPATH=LIBPATH)    test = testenv.Program('test-arac', Glob('src/cpp/tests/*.cpp'))

libarac.so is successfully being generated earlier in the build process.

any ideas on how to get around this problem?

thanks!

Reply to this email directly or view it on GitHub: https://github.com/bayerj/arac/issues/12

Dipl. Inf. Justin Bayer Lehrstuhl für Robotik und Echtzeitsysteme, Technische Universität München http://www6.in.tum.de/Main/Bayerj

BAM-BAM-BAM commented 13 years ago

unfortunately I don't think it's that easy.

I'm using the Windows python2.7 binary, since it was fairly easy to get scipy installed and running with it. I had tried to use the python packaged with cygwin, but after a couple of days gave up on it since I could not get scipy compiled with it.

Since I'm using the Windows version of python, I think libarac must be compiled as a .dll or .pyd. And this seems difficult since it seem like I would have to come up with all new project files, dependencies, etc. (i.e. throw away the entire build/make code that comes with arac.)

I did try symbolic links, copying the file to multiple locations (/usr/local/lib, /usr/lib) etc. The library, when renamed to libarac.dll or libarac.pyd was found by the linker but I just couldn't get it to resolve all the link references.

So I haven't figure out how to build for Wndows/cygwin yet; I'm just using slow networks :(

bayerj commented 13 years ago

I have no experience making arac run on windows. I also do not have access to a windows machine to try things out - so I fear you are on you own.

You can try the PyBrian mailinglist (see http://pybrain.org for more info). Let me know if you succeed.

On 18 September 2011 02:11, BAM-BAM-BAM reply@reply.github.com wrote:

unfortunately I don't think it's that easy.

I'm using the Windows python2.7 binary, since it was fairly easy to get scipy installed and running with it.  I had tried to use the python packaged with cygwin, but after a couple of days gave up on it since I could not get scipy compiled with it.

Since I'm using the Windows version of python, I think libarac must be compiled as a .dll or .pyd.  And this seems difficult since it seem like I would have to come up with all new project files, dependencies, etc. (i.e. throw away the entire build/make code that comes with arac.)

I did try symbolic links, copying the file to multiple locations (/usr/local/lib, /usr/lib) etc.  The library, when renamed to libarac.dll or libarac.pyd was found by the linker but I just couldn't get it to resolve all the link references.

So I haven't figure out how to build for Wndows/cygwin yet; I'm just using slow networks :(

Reply to this email directly or view it on GitHub: https://github.com/bayerj/arac/issues/12#issuecomment-2124771

Dipl. Inf. Justin Bayer Lehrstuhl für Robotik und Echtzeitsysteme, Technische Universität München http://www6.in.tum.de/Main/Bayerj

agcala commented 4 years ago

Try the following

libenv = Environment(target='libarac.dll',LIBS=['libblas','msvcrt'], CPPPATH=CPPPATH, LIBPATH=LIBPATH,
         SHLIBPREFIX="", CCFLAGS=CCFLAGS)

That would resolve your link references. Be sure you have BLAS installed and on path and that msvcrt.dll is on path.