I am trying to install NrrdIO on Ubuntu 18.04, to run Marching Cubes to segment medical images. This is the link from which I'm trying to run it.
http://web.cse.ohio-state.edu/research/graphics/isotable/
I'm trying to install ijkmcube-v0-3-3.tar, which requires the ITKNrrdIO.a library. I'm running into this error:
[ 7%] Linking CXX executable ijkmcube
/usr/bin/ld: cannot find -lNrrdIO
collect2: error: ld returned 1 exit status
CMakeFiles/ijkmcube.dir/build.make:406: recipe for target 'ijkmcube' failed
make[2]: *** [ijkmcube] Error 1
CMakeFiles/Makefile2:131: recipe for target 'CMakeFiles/ijkmcube.dir/all' failed
make[1]: *** [CMakeFiles/ijkmcube.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
I've installed NrrdIO 1.11.0, and tried with NrrdIO 1.9.0 as well, but while running
make
I always run into this error, for some reason its not able to find lNrrdIO . Can someone please help?
Thanks
Edit:
I think its a problem with the linking, but when I copied the NrrdIO.a file to /usr/bin and modified the symbolic link to point to it, I got an error as follows:
[ 7%] Linking CXX executable ijkmcube
collect2: fatal error: cannot find 'ld'
compilation terminated.
CMakeFiles/ijkmcube.dir/build.make:406: recipe for target 'ijkmcube'
failed
make[2]: *** [ijkmcube] Error 1
CMakeFiles/Makefile2:131: recipe for target '
CMakeFiles/ijkmcube.dir/all' failed
make[1]: *** [CMakeFiles/ijkmcube.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Can someone help? Thank you
Edit 2
PROJECT(IJKMCUBE)
#---------------------------------------------------------
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
IF (NOT DEFINED ${IJK_DIR})
GET_FILENAME_COMPONENT(IJK_ABSOLUTE_PATH "../.." ABSOLUTE)
SET(IJK_DIR ${IJK_ABSOLUTE_PATH} CACHE PATH "IJK directory")
ENDIF (NOT DEFINED ${IJK_DIR})
SET(CMAKE_INSTALL_PREFIX "${IJK_DIR}/")
SET(LIBRARY_OUTPUT_PATH ${IJK_DIR}/lib CACHE PATH "Library directory")
SET(IJKMCUBE_DIR "src/ijkmcube")
SET(NRRD_LIBDIR "${IJK_DIR}/lib")
SET(IJK_ISOTABLE_DIR "${IJK_DIR}/isotable" CACHE PATH "Isotable
directory")
#---------------------------------------------------------
IF (NOT CMAKE_BUILD_TYPE)
SET (CMAKE_BUILD_TYPE Release CACHE STRING
"Default build type: Release" FORCE)
ENDIF (NOT CMAKE_BUILD_TYPE)
INCLUDE_DIRECTORIES("${IJK_DIR}/include")
LINK_DIRECTORIES("${NRRD_LIBDIR}")
LINK_LIBRARIES(expat NrrdIO z)
ADD_DEFINITIONS(-DIJK_ISOTABLE_DIR=\"${IJK_ISOTABLE_DIR}\")
ADD_EXECUTABLE(ijkmcube ijkmcube_main.cxx ijkmcubeIO.cxx ijkmcube.cxx
ijkmcube_datastruct.cxx ijkmcube_sub.cxx
ijkmcube_extract.cxx ijkmcube_util.cxx
ijksnapmc.cxx
ijktable.cxx ijktable_poly.cxx ijktable_ambig.cxx
ijkoctree.cxx ijkxitIO.cxx)
ADD_LIBRARY(ijkmcubeL STATIC EXCLUDE_FROM_ALL ijkmcubeIO.cxx
ijkmcube.cxx ijkmcube_datastruct.cxx ijkmcube_sub.cxx
ijkmcube_extract.cxx ijkmcube_util.cxx ijksnapmc.cxx
ijktable.cxx ijkoctree.cxx ijkxitIO.cxx)
SET_TARGET_PROPERTIES(ijkmcubeL PROPERTIES OUTPUT_NAME ijkmcube)
ADD_CUSTOM_TARGET(lib DEPENDS ijkmcubeL)
SET(CMAKE_INSTALL_PREFIX ${IJK_DIR})
INSTALL(TARGETS ijkmcube DESTINATION "bin/linux")
ADD_CUSTOM_TARGET(tar WORKING_DIRECTORY ../.. COMMAND tar cvfh
${IJKMCUBE_DIR}/ijkmcube.tar ${IJKMCUBE_DIR}/README
${IJKMCUBE_DIR}/INSTALL ${IJKMCUBE_DIR}/RELEASE_NOTES
${IJKMCUBE_DIR}/*.cxx ${IJKMCUBE_DIR}/*.h ${IJKMCUBE_DIR}/*.txx
${IJKMCUBE_DIR}/CMakeLists.txt ${IJKMCUBE_DIR}/man/*
${IJKMCUBE_DIR}/ijkmcube_doxygen.config)
ADD_CUSTOM_TARGET(doc COMMAND doxygen ijkmcube_doxygen.config)
SOLVED
Tsyvarev solved it, the libNrrdIO.a file has to be copied to /usr/lib/. Refer to comments for the exact solution
This answer was given by #Tsyvarev:
By making a link named ld you are removing the original linker (ld). Without the linker you definitely cannot build any library. What you need is to make a link named lNrrdIO.a, so it will point to the actual library location: sudo ln -sfn /home/subham/Downloads/NrrdIO-1.9.0-src/lNrrdIO.a lNrrdIO.a (run this command from /usr/lib directory). And restore original /usr/bin/ld file.
Related
I'm trying to cross compiling ROS Melodic for aarch64 on raspberry pi 3 with toolchain that created by buildroot.
I followed the document http://wiki.ros.org/ROS/CrossCompiling/RaspberryPi/Cross-Compile%20ROS%20for%20the%20RaspberryPi, the source of ROS I try to build comes from:
rosinstall_generator ros_comm --rosdistro melodic --deps --tar > melodic-ros_comm.rosinstall
wstool init -j8 src melodic-ros_comm.rosinstall
And I got the error messages like these:
[100%] Linking CXX shared library /home/developer/ros_pi/ros_catkin_ws/devel_isolated/class_loader/lib/libclass_loader.so
/home/developer/buildroot-2020.02.1/output/host/lib/gcc/aarch64-buildroot-linux-gnu/8.4.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: /home/developer/buildroot-2020.02.1/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libboost_thread.so: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
CMakeFiles/class_loader.dir/build.make:180: recipe for target '/home/developer/ros_pi/ros_catkin_ws/devel_isolated/class_loader/lib/libclass_loader.so' failed
make[2]: *** [/home/developer/ros_pi/ros_catkin_ws/devel_isolated/class_loader/lib/libclass_loader.so] Error 1
CMakeFiles/Makefile2:195: recipe for target 'CMakeFiles/class_loader.dir/all' failed
make[1]: *** [CMakeFiles/class_loader.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
<== Failed to process package 'class_loader':
Command '['/home/developer/ros_pi/ros_catkin_ws/install_isolated/env.sh', 'make', '-j8', '-l8']' returned non-zero exit status 2
Reproduce this error by running:
==> cd /home/developer/ros_pi/ros_catkin_ws/build_isolated/class_loader && /home/developer/ros_pi/ros_catkin_ws/install_isolated/env.sh make -j8 -l8
Command failed, exiting.
This is my toolchain.cmake:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_LIBRARY_ARCHITECTURE aarch64)
set( CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/home/developer/buildroot-2020.02.1/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/")
set( CMAKE_C_COMPILER aarch64-linux-gcc)
set( CMAKE_CXX_COMPILER aarch64-linux-g++)
set(CMAKE_FIND_ROOT_PATH "/home/developer/buildroot-2020.02.1/output/host/aarch64-buildroot-linux-gnu/sysroot")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
include_directories(/home/developer/buildroot-2020.02.1/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/)
I guess the problem comes from boost?
The version of boost which I used is 1.65.1
All the steps I tried is contained in Dockerfile as link as below:
https://github.com/i-am-neet/cc-ros/blob/master/Dockerfile
Thank you for your patience
I'm using inet4 omnet5.5.1 veins5 I imported veins_inet in the workspace but it doesn't build successfully even though I added the paths to inet and veins src files in project properties I got the following error:
15:29:41 **** Incremental Build of configuration gcc-debug for project veins_inet ****
make MODE=debug all
make[1]: Entering directory '/home/nai/omnetpp-5.5.1/myWorkspace/veins_inet/src'
Creating shared library: ../out/gcc-debug/src/libveins_inet_dbg.so
/usr/bin/ld: cannot find -lINET_dbg
Makefile:141: recipe for target '../out/gcc-debug/src/libveins_inet_dbg.so' failed
make[1]: Leaving directory '/home/nai/omnetpp-5.5.1/myWorkspace/veins_inet/src'
Makefile:36: recipe for target 'all' failed
/usr/bin/ld: cannot find -lveins_dbg
collect2: error: ld returned 1 exit status
make[1]: *** [../out/gcc-debug/src/libveins_inet_dbg.so] Error 1
make: *** [all] Error 2
"make MODE=debug all" terminated with exit code 2. Build might be incomplete.
15:29:43 Build Failed. 6 errors, 0 warnings. (took 1s.693ms)
apparently some required files are missing
how to fix this please
You might be building this project in debug mode, but not building the other projects in debug mode.
[ 59%] Compiling bitmap2component's resource file
gcc: error: Sanchez/AppData/Roaming/SPB_Data/src/MINGW-Packages/mingw-w64-kicad-git/src/kicad/bitmap2component: No such file or directory
E:\Documents2\MSYSkicadbuild\mingw64\bin\windres.exe: preprocessing failed.
make[2]: *** [bitmap2component/CMakeFiles/bitmap2component.dir/build.make:62: bitmap2component/CMakeFiles/bitmap2component.dir/bitmap2component_rc.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:1979: bitmap2component/CMakeFiles/bitmap2comp onent.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Compiled kicad on msys2 followed http://kicad-source-mirror.readthedocs.io/en/latest/Documentation/development/compiling/index.html#building-kicad-from-source
It says there is no such file or directory but there is...
MSYS ~/src/MINGW-Packages/mingw-w64-kicad-git/src/kicad
$ ls
_clang-format cvpcb lib_dxf README.txt
3d-viewer demos new resources
AUTHORS.txt Documentation pagelayout_editor scripting
**bitmap2component** Doxyfile patches scripts
bitmaps_png eeschema pcb_calculator template
CMakeLists.txt gerbview pcbnew TODO.txt
CMakeModules helpers plugins tools
common include polygon uncrustify.cfg
copyright.h INSTALL.txt potrace utils
CTestConfig.cmake kicad qa
this is what is inside bitmap2component
bitmap2cmp_gui.cpp bitmap2component.cpp CMakeLists.txt
bitmap2cmp_gui_base.cpp bitmap2component.h Info.plist
bitmap2cmp_gui_base.fbp bitmap2component.icns
bitmap2cmp_gui_base.h bitmap2component.rc
I must be missing something a path or file idk any help would be appreciated.
ohh not sure if this help figure anything out but it will keep compiling to around 71% and then tell me something about eeschema_kiface error.
When I try to build Artery on Ubuntu 16.04. the following happens after invoking
$ cmake --build /home/hardt/Veins/artery-master/build
[ 23%] Linking CXX shared library libartery.so
/usr/bin/ld: /usr/local/lib/libvanetza_btp.a(data_request.cpp.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared
object; recompile with -fPIC
/usr/local/lib/libvanetza_btp.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
src/artery/CMakeFiles/artery.dir/build.make:954: recipe for target'src/artery/libartery.so' failed
make[2]: *** [src/artery/libartery.so] Error 1
CMakeFiles/Makefile2:229: recipe for target 'src/artery/CMakeFiles/artery.dir/all' failed
make[1]: *** [src/artery/CMakeFiles/artery.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
As I am not all that familiar with building source on Unix systems I am not quite sure how to deal with this error.
I am using cmake version 3.9.3, boost 1.65.1 and crypto++ 5.6.4 the geographiclib built without error as well.
As one can read in the comments, the problem is solved.
The path to the vanetza directory VANETZA_DIR in the cmake configuration was wrong. Correcting this via ccmake solved the problem.
I want to make network simulator shawn.exe with cygwin and that simulator need to boost library
when i call make for it in the linking step procedure break.
please help me,
this is all result of make command:
{.
.
[100%] Built target shawnlib
Scanning dependencies of target shawn
[100%] Building CXX object CMakeFiles/shawn.dir/frontend/console/con_main.o
[100%] Building CXX object CMakeFiles/shawn.dir/apps/apps_init.o
Linking CXX executable shawn.exe
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lboost_regex-gcc-mt
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lboost_date_time-gcc-mt
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lboost_thread-gcc-mt
collect2: ld returned 1 exit status
CMakeFiles/shawn.dir/build.make:111: recipe for target `shawn.exe' failed
make[2]: *** [shawn.exe] Error 1
CMakeFiles/Makefile2:60: recipe for target `CMakeFiles/shawn.dir/all' failed
make[1]: *** [CMakeFiles/shawn.dir/all] Error 2
Makefile:72: recipe for target `all' failed
make: *** [all] Error 2
}
Make sure you have the libboost-devel Cygwin package installed. Re-run Cygwin's setup.exe and install that package (as well as its dependencies, which should automatically get installed if you don't explicitly exclude them).
no need to reinstall cygwin. just run:
apt-cyg install libboost-devel.
if you don't have "apt-cyg" installed, run these steps first:
lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg
install apt-cyg /bin