why is this not finding my shared object file in eclipse cdt (using intel mkl)? - eclipse-cdt

I'm testing the Intel MKL using Eclipse and I get my code to compile just fine.
12:31:41 **** Incremental Build of configuration Debug for project YKP_C ****
make all
make: Nothing to be done for 'all'.
12:31:41 Build Finished (took 85ms)
However, I keep getting an error message
/home/ypitcan/workspace/YKP_C/Debug/YKP_C: error while loading shared libraries: libmkl_intel_lp64.so: cannot open shared object file: No such file or directory
when I try to run the code.
This is my configuration, which looks right according to the instructions online.
Please I don't know what to do.

Your compilation/linking phase is working fine from the screenshots shared.
What is failing is the running. You need to tell the program, when you run it, where to find libmkl_intel_lp64.so.
To do that, normally you set LD_LIBRARY_PATH environment variable which works sort of like PATH but for finding .so files.

Related

Compiling LZ4 compression library on Windows

I'm trying to use the LZ4 compression library with a C++ project in Visual Studio 2013. I need to build the .dll files for it so I can link it in the project. I'm trying to use mingw to build it with the make file, but that is throwing unpleasant errors. Navigating to the base directory of the repository and running mingw32-make.exe gives the following error output:
process_begin: CreateProcess(NULL, uname, ...) failed.
The filename, directory name, or volume label syntax is incorrect.
Makefile:72: recipe for target 'lz4programs' failed
mingw32-make: *** [lz4programs] Error 1
I'm not overly familiar with compiling make files on Windows, and am having difficulty with figuring out what's causing the error. Additionally, in something that I find rather odd given how popular this compression library is, I cannot find any information online about compiling it for Windows. Any assistance in getting this thing to compile would be greatly appreciated.
I was able to use CMake with the CMakeLists.txt file in the cmake_unofficial folder to compile the library and the lz4 executable.
The solution is compiling a static version of the library. If you want a dll version, you should be able to experiment with the Visual Studio settings to get the dll if the static library isn't sufficient.

Following a Lynda.com c++ tutorial and having problems setting up paths on Eclipse (OSX 10.9.3)

I am currently learning C++ using Lynda.com tutorials, I am a complete beginner and am following the tutorials on how to set up Eclipse on my Mac.
When I initially run the version-test.cpp program provided, it runs fine with the expected output (GCC version 4.2.1)
The tutorial requires my Mac to be running GCC version 4.7.0 or above and it explains how to upgrade GCC. The tutorial instructs me to save the updated GCC files within my home directory within the folder hpc-gcc and then follows on to explain the method to set my PATHs to find this folder.
Now when I run the version-test.cpp program it fails with the following error
dyld: Library not loaded: /usr/local/lib/libmpc.3.dylib
Referenced from: /Users/gary/hpc-gcc/bin/../libexec/gcc/x86_64-apple-darwin13.1.0/4.9.0/cc1plus
Reason: image not found
So from this message I can see that the system cannot find the required files within /usr/local/lib.
I am able to copy the files from hpc-gcc/bin to /usr/local/lib and have the program compile and run correctly but I am hoping to find out why Eclipse cannot read the required files directly from ~/hpc-gcc/bin
I have spent the last 2 hours searching forums and search engines for the answer but I am no further forward. I realise I can simply have the GCC files within /usr/local/lib and it will work but I want to understand where I am going wrong.
Solved.
You need to go into the properties of the Working folder (if you are following the lynda.com program you will understand the working folder) and under C/C++ Build -> Environment menu (Where we added in the LIBRARY_PATH, PATH, AND CPATH variables) and add in DYLD_LIBRARY_PATH with a value of ${HOME}/hpc-gcc/lib.
Remember the C/C++ Build "menus" are for build and debug, so the project is not able to find the library for the building process.
And you will be good to go.

lib clang.dylib: change installation path

I have a problem using libclang:
I built libclang locally. It resides somewhere like clang-llvm/…/libclang.3.4.dylib.
Then I developed a foundation tool using that dylib. (exactly: I copied a version to my project folder and linked against this.) The foundation tool works fine. But, of course, at load time it uses the dylib in my local build folder. This is unacceptable, because the user of the tool has to install clang to use my tool.
So I copied libclang.3.4.dylib to a location inside /usr/…/libclang.3.4.dylib and changed the installation path to that location using install_name_path -id /usr/…/libclang.3.4.dylib /usr/…/libclang.3.4.dylib.
After that my tool finds the dylib there but does not work since the parser cannot find stdarg.h any more in the file, that is parsed by my tool.
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:12:10: fatal error: 'stdarg.h' file not found
How can I set the installation path of libclang.3.4.dylib to something public?
Amin, my good friend.
<sarcasm>
From what you wrote it should be OBVIOUS to EVERYONE that you have to create a release build of your tool and NOT a debug build. Xcode should have told you that in the form of CLEAR and EASY to understand error messages.
</sarcasm>
Solution: Use a release build of your tool instead of a debug build.
:)

Why is my program trying to use libluajit-5.1.so.2 instead of libluajit.so?

I have a project I'm writing that uses LuaJIT. I'm trying to run my project on a computer I have not run it on in a while. It used to run just fine but now when I try to run it it complains.
I have LuaJIT in my source tree, and it builds just fine. I'm using CMake to generate my make files, and as far as I can tell CMake finds the file libluajit.so, but when I run my program, I get the following error:
../build/game/game: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory
I don't know why it's looking for that version of the library instead of libluajit.so. This is Ubuntu linux for what it's worth. I can add more details if necessary, I can add more details if necessary, I'm not sure what info would be helpful to figure out happening.
Edit:
To build and link the program I have these lines in the file CMakeLists.txt (this is abbreviated a bit to just show the relevant bits)
find_package(LuaJIT REQUIRED)
set(Extern_LIBS luajit)
add_executable(proj ${proj_Sources})
target_link_libraries(proj ${Extern_LIBS})
After I run cmake on my source directory, I run make. Then to run it I just run ./proj
When you built it, the ".so" was actually a symlink to the library. Verisioned filenames and SONAMEs are used so that multiple versions of a library can coexist, preventing problems commonly found on... other operating systems whereby older software is incompatible with the newer library, and newer software is incompatible with the older library.

WxWidgets Application Run Failed

After hours i was finally able to compile the wxwidgets-2.8.12 library as follows:-
I unzipped the .zip into a folder D:\wxwidgets2812\wxwidgets-2.8.12
I went in D:\MinGW\MSYS\1.0 run the batch file and did the following:-
Went to the following path:-
cd /d/{WXWIN}/build/msw
and compiled the library in the following way as :-
mingw32-make -f makefile.gcc MONOLITHIC=0 SHARED=1 UNICODE=0 BUILD=release
It Build /Compiled succesfully Then I added in the project properties ->include directories ->D:\wxwidgets2812\wxwidgets-2.8.12\include ,addidtional options->wx-config --cxxflags,in linker i added in libraries->wx-config --libs
Now when i run my code / project ,it gives me following errors:-
The application failed with exit code -1073741515 (0xc0000135).
This could indicate that no required .dll was found in the PATH.
Please try to start the following command from the command shell (cmd.exe).
This may give some additional information.
C:\Users\Lenovo\Documents\NetBeansProjects\CppApplication_6\dist\Debug\MinGW_1-
Windows\cppapplication_6
RUN FAILED (exit value -1,073,741,515, total time: 22ms)
Please help me running the application.
Thanks
" This could indicate that no required .dll was found in the PATH"
This suggests that you have built your application to link to a DLL containing the wxWidgets library.
You can go two ways from here:
Change your application build to link statically to the library. You will also have to build wxWidgets to generate a static library if you have not already done so.
Copy the wxWidgets DLL into your path. ( Or add the DLL folder to your path as a quick fix to get you started. )
Option #2 is probably simpler for now, since you seem to have built the DLL version of wxWidgets. So, you need to find the wxWidgets DLL that was created when you built wxWidgets and move it into your path.