Skip to content
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

centos -lstdc++ linking error: need libstdc++-static #137

Closed
WillForan opened this issue Oct 10, 2017 · 7 comments
Closed

centos -lstdc++ linking error: need libstdc++-static #137

WillForan opened this issue Oct 10, 2017 · 7 comments

Comments

@WillForan
Copy link

WillForan commented Oct 10, 2017

cd build/console-build && make

/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status

resolved with yum install libstdc++-static

on

CentOS Linux release 7.3.1611 (Core)
centos-release-0:7-4.1708.el7.centos.x86_64

I'm not sure if this qualifies as a proper issue. It probably says more about the distribution install than the "no dependencies" claim of the read me. But it took me a while to figure out. So I'm trying to leave some breadcrumbs for anyone else lost in the same woods.

@WillForan
Copy link
Author

WillForan commented Oct 10, 2017

resolved with yum install libstdc++-static which provides

/usr/lib/gcc/x86_64-redhat-linux/4.8.2/libstdc++.a

neurolabusc added a commit that referenced this issue Oct 11, 2017
@neurolabusc
Copy link
Collaborator

I have updated the documents to reflect this. @ningfei do you think we could upgrade your SuperBuild to ensure libstdc++ is installed?

@ningfei
Copy link
Collaborator

ningfei commented Oct 11, 2017

@neurolabusc have a quick look of this, no quick solution so far... We probably need to find a way to check the existence of libstdc++.a to ensure this.
Currently we use a file ucm.cmake (which contains a collection of useful cmake macros) to handle the static/dynamic link option. And static runtime (link option -static-libstdc++ and -static-libgcc) is chosen by default for ease of release/distribution. One can set USE_STATIC_RUNTIME to OFF in cmake if a shared build is desired or static libstdc++ is not available.

yarikoptic added a commit to neurodebian/dcm2niix that referenced this issue Jan 24, 2018
* commit 'v1.0.20171017-3-g9ccc4c0':
  Detect SMS using 0051,1011 if MosaicRefAcqTimes missing rordenlab#141
  Hide NIfTI sliceOrder if protocolSliceNumber1 > 1
  SliceTiming for reversed image numbering https://github.com/neurolabusc/dcm2niix/issues/40
  Update dcm_qa submodule.
  New version (v1.0.20171017)
  Added link rordenlab#138
  Store mulbiband factor in NIfTI descrip field (e.g. "mb=2") https://www.nitrc.org/forum/message.php?msg_id=22593
  Add patient sex, weight, etc, https://www.nitrc.org/forum/message.php?msg_id=22567
  Add ImageOrientationPatientDICOM and InPlanePhaseEncodingDirectionDICOM for 3D undistortion
  Compiling with CentOS 7: rordenlab#137
  BIDS 1.0.2 DelayTime field for sparse fMRI
  Add InstitutionalDepartmentName
  Get ProtocolName from CSA header if it is not in DICOM header nipy/heudiconv#80
  Change name of output tag of two variables to match DICOM
  Group PixelBandwidth with DwellTime in output json
  Vanquish compiler warnings.
  Report lower order shims prior to higher order (requested by mharms)
  Handle Siemens product gradient offsets?
  More Siemens information saved to BIDS
  BIDS: Do not set multiband factor for 3D EPI, report as "MRAcquisitionType": "3D",
@fedorov
Copy link

fedorov commented Feb 22, 2018

@WillForan thank you! I had the same problem with a docker build, and this issue was the first hit from google search! 👍

ningfei added a commit that referenced this issue Feb 22, 2018
…E" is ON.

For some Centos/Redhat systems. See #137.
@BrennanHickson
Copy link

I'm running into this error while attempting to install on a supercomputer account for which I have no elevated privileges. I am therefore unable to resolve the issue with yum install libstdc++-static. Are there any alternatives?

@ningfei
Copy link
Collaborator

ningfei commented Jun 14, 2018

@BrennanHickson You can try to set the option USE_STATIC_RUNTIME to OFF in CMake.

@BrennanHickson
Copy link

@ningfei That was the solution I opted for initially.

@neurolabusc offered another successful command to be entered directly in the console directory:

g++ -O3 -I. main_console.cpp nii_foreign.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp -o dcm2niix -DmyDisableOpenJPEG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants