-
Notifications
You must be signed in to change notification settings - Fork 6
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
Problem in running the example #31
Comments
The most probable cause is that the library was linked to different library versions than the example, likely GSL/BLAS The example compile command assumes all libraries are in standard locations. Further, if shared libraries like GSL used for building reprimand are not in the standard linker search path, but other versions are, then problems like this can result. To diagnose, please run |
Thanks. I tried Then I tried
It seems that the compatibility version is different than the current version. I would be glad if a workaround could be found to test the example. |
please run otool also on the libRePrimAnd.dylib shared library. I suspect a problem with the GSL and/or the CBLAS library dependencies. Could it be that one or both of these are installed in different versions both on your system and the conda environment? If reprimand was compiled using a library inside a non-standard location, the system might not be able to find it anymore when running a program linked to reprimand, or it might try to use the wrong version. This is a problem frequently encountered when installing software from source. |
After I run otool on the libRePrimAnd.dylib shared library.
The output is as follows:
I checked that CBLAS library is installed only on the conda environment while GSL library is installed only on the system (using homebrew).
During installation, I did not specify library locations manually except for the Boost. |
The problem seems related to linking error to CBLAS library.
and the produced executable can be run successfully and output was shown without any issues.
and it showed the same CBLAS linking problem on the standard output
I was wondering if this problem could also be solved if at the runtime CBLAS library could be linked somehow like number 1.
|
Regarding 1) it is odd that one has to link cblas manually. reprimand does not depend directly on cblas but it depends on gsl library which in turn depends on cblas. Not sure what is going on here. It could either be that the dynamic linker behaves subtly different on MacOS (I don't have a Mac available at the moment so I will investigate later) or, more likely, that somehow your install of gsl+cblas is somehow broken. You can try installing gsl inside the conda environment as well and try building the example with that, using -L and -I options to point to the lib and include directory of gsl/cblas versions in your conda environment. |
Regarding 2) please check that the python3 executable used to run the python example is the one from the conda environment used for building and installing reprimand. |
When running code on MacOs that was linked to libraries in non-system locations at build time, it may also be required to set the environment variable |
I suspect that system-wide "/usr/bin/python3" python3 was used for installing the python binding of reprimand. When I run the command:
the error related to CBLAS disappeared and the error is now that it is unable to find reprimand module:
I did not specify --prefix option to customize the installation location during building the library. I understand that mixing things (libraries and executables) sometimes from system-wide and sometimes from conda environment is a mess. I would like to use and keep everything bound to conda environment. However, I would like to know if meson will search and choose dependent libraries from conda environment first and if not found then it will search system-wide ? After reprimand is installed, should I specify the location of reprimand library in a code or it will automatically detect similarly if it is installed system-wide ? |
I installed all the dependencies of reprimand library (gsl,hdf5,boost) inside a conda environment and then built the reprimand library inside conda environment using --prefix option during building the library.
It successfully built the executable and was run successfully without any CBLAS linking separately by
Defining 'DYLD_LIBRARY_PATH' environment variable is a workaround to find 'libRePrimAnd.dylib', otherwise the following error appears when we run
this error seems to me because of the non-standard installation location of reprimand library. Also, python binding works properly without any error. |
That is never required. All compilers and build systems provide options for specifying the search path for header files. Compiling C++ code with reprimand works like for any other library: either header files and the library file are installed in standard search locations on the system or one has to specify the locations. When using g++ compiler, the options are -I for include file search path(es) and -L for library search path(es). |
Thanks for the feedback. I am closing this ticket now since it was apparently not a problem specific to reprimand. Installing any software package from source requires a certain amount of experience since every system is different. This is not something one can expect from the average MacOS user. I've put pre-build MacOS binaries on my todo list as ticket #33. |
I have successfully built and installed RePrimAnd from the source on my Mac m2 Ventura. Then I compiled the example successfully "/<repository>/examples/minimal_tov.cc" by command
g++ -lRePrimAnd -I/opt/homebrew/opt/boost/include --std=c++11 minimal_tov.cc
and it generated "a.out" executable. When I tried./a.out
to run the example it gave an error"dyld[74642]: symbol not found in flat namespace '_cblas_caxpy'
zsh: abort ./a.out"
I could not understand the root of this problem to find a way out.
The text was updated successfully, but these errors were encountered: