Project

General

Profile

cdo 2.0.6 fails to compile on Mac OS intel

Added by Remko Scharroo about 2 years ago

I've tried to compile cdo 2.0.6 on a Mac OS intel with macports installed, but the compilation fails (see below).
Until cdo 2.0.5 I never had an issue compiling cdo.
Any hints?

Here is the end of the log:

:info:build libtool: link: /usr/bin/clang++ -std=gnu++17 -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch x86_64 -pthread -Wl,-headerpad_max_install_names -Wl,-rpath -Wl,/opt/local/lib/libgcc -Wl,-syslibroot -Wl,/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch x86_64 -o cdo cdo-cdo.o cdo-Adisit.o cdo-Afterburner.o cdo-Arith.o cdo-Arithc.o cdo-Arithdays.o cdo-Arithlat.o cdo-Bitrounding.o cdo-Cat.o cdo-CDIread.o cdo-CDItest.o cdo-CDIwrite.o cdo-Change.o cdo-Change_e5slm.o cdo-Cloudlayer.o cdo-CMOR.o cdo-CMOR_lite.o cdo-CMOR_table.o cdo-Collgrid.o cdo-Command.o cdo-Comp.o cdo-Compc.o cdo-Complextorect.o cdo-Cond.o cdo-Cond2.o cdo-Condc.o cdo-Consecstat.o cdo-Copy.o cdo-DCW_util.o cdo-Dayarith.o cdo-Deltat.o cdo-Deltime.o cdo-Depth.o cdo-Derivepar.o cdo-Detrend.o cdo-Diff.o cdo-Distgrid.o cdo-Duplicate.o cdo-EOFs.o cdo-Eof3d.o cdo-EcaIndices.o cdo-EcaEtccdi.o cdo-Echam5ini.o cdo-Enlarge.o cdo-Enlargegrid.o cdo-Ensstat.o cdo-Ensstat3.o cdo-Ensval.o cdo-Eofcoeff.o cdo-Eofcoeff3d.o cdo-EstFreq.o cdo-Exprf.o cdo-FC.o cdo-Filedes.o cdo-Fillmiss.o cdo-Filter.o cdo-Fldrms.o cdo-Fldstat.o cdo-Fldstat2.o cdo-Fourier.o cdo-Gengrid.o cdo-Gradsdes.o cdo-Gridboxstat.o cdo-Gridcell.o cdo-Gridsearch.o cdo-Harmonic.o cdo-Hi.o cdo-Histogram.o cdo-Importamsr.o cdo-Importbinary.o cdo-Importcmsaf.o cdo-Importobs.o cdo-Importfv3grid.o cdo-Info.o cdo-Input.o cdo-Intgrid.o cdo-Intgridtraj.o cdo-Intlevel.o cdo-Intlevel3d.o cdo-Intntime.o cdo-Inttime.o cdo-Intyear.o cdo-Invert.o cdo-Invertlev.o cdo-Lic.o cdo-MapReduce.o cdo-Maskbox.o cdo-Mastrfu.o cdo-Math.o cdo-Merge.o cdo-Mergegrid.o cdo-Mergetime.o cdo-Merstat.o cdo-Monarith.o cdo-Mrotuv.o cdo-Mrotuvb.o cdo-NCL_wind.o cdo-Ninfo.o cdo-Nmldump.o cdo-Output.o cdo-Outputgmt.o cdo-Pack.o cdo-Pardup.o cdo-Pinfo.o cdo-Pressure.o cdo-Recttocomplex.o cdo-Regres.o cdo-Remap.o cdo-Remapweights.o cdo-Remapeta.o cdo-Remapstat.o cdo-Replace.o cdo-Replacevalues.o cdo-Rhopot.o cdo-Rotuv.o cdo-Runpctl.o cdo-Runstat.o cdo-Samplegrid.o cdo-Samplegridicon.o cdo-Seascount.o cdo-Seaspctl.o cdo-Seasstat.o cdo-Seasmonstat.o cdo-Selbox.o cdo-Selgridcell.o cdo-Select.o cdo-Selmulti.o cdo-Seloperator.o cdo-Selrec.o cdo-Selregion.o cdo-Selsurface.o cdo-Seltime.o cdo-Selvar.o cdo-Selyearidx.o cdo-Set.o cdo-Setattribute.o cdo-Setbox.o cdo-Setgrid.o cdo-Setgridcell.o cdo-Sethalo.o cdo-Setmiss.o cdo-Setpartab.o cdo-Setrcaname.o cdo-Settime.o cdo-Setzaxis.o cdo-Shiftxy.o cdo-Showinfo.o cdo-Showattribute.o cdo-Sinfo.o cdo-Smooth.o cdo-Sort.o cdo-Sorttimestamp.o cdo-Specinfo.o cdo-Spectral.o cdo-Spectrum.o cdo-Split.o cdo-Splitrec.o cdo-Splitsel.o cdo-Splittime.o cdo-Splityear.o cdo-Tee.o cdo-Templates.o cdo-Test.o cdo-Tests.o cdo-Timcount.o cdo-Timcumsum.o cdo-Timfill.o cdo-Timpctl.o cdo-Timselpctl.o cdo-Timselstat.o cdo-Timsort.o cdo-Timstat.o cdo-Timstat2.o cdo-Timstat3.o cdo-Tinfo.o cdo-Tocomplex.o cdo-Transpose.o cdo-Trend.o cdo-Trendarith.o cdo-Tstepcount.o cdo-Unpack.o cdo-Vargen.o cdo-Varrms.o cdo-Varsstat.o cdo-Vertintap.o cdo-Vertintgh.o cdo-Vertintml.o cdo-Vertintzs.o cdo-Vertstat.o cdo-Vertcum.o cdo-Vertwind.o cdo-Verifygrid.o cdo-Wct.o cdo-Wind.o cdo-WindTrans.o cdo-Writegrid.o cdo-Writerandom.o cdo-XTimstat.o cdo-Yeararith.o cdo-Yearmonstat.o cdo-Ydayarith.o cdo-Ydaypctl.o cdo-Ydaystat.o cdo-Ydrunpctl.o cdo-Ydrunstat.o cdo-Yhourarith.o cdo-Yhourstat.o cdo-Ymonarith.o cdo-Ymonpctl.o cdo-Ymonstat.o cdo-Yseaspctl.o cdo-Yseasstat.o cdo-Zonstat.o cdo-Maggraph.o cdo-Magplot.o cdo-Magvector.o cdo-template_parser.o cdo-results_template_parser.o cdo-magics_template_parser.o cdo-string_utilities.o cdo-cdo_magics_mapper.o  -L/opt/local/lib -L/opt/local/lib/proj8/lib ./.libs/libcdo.a ../libcdi/src/.libs/libcdi.a ../src/lib/yac/.libs/libyac.a ../src/lib/gradsdes/.libs/libgradsdes.a -lhdf5 -lpng -lopenjpeg -lcurl -lproj -lfftw3 -leccodes -ludunits2 -lnetcdf -lhdf5_hl -lpthread -pthread
:info:build Undefined symbols for architecture x86_64:
:info:build   "std::__1::enable_if<(is_move_constructible<double>::value) && (is_move_assignable<double>::value), void>::type std::__1::swap<double>(double&, double&)", referenced from:
:info:build       cdo::fft(double*, double*, int, int) in libcdo.a(libcdo_la-cdo_fft.o)
:info:build ld: symbol(s) not found for architecture x86_64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:build make[2]: *** [cdo] Error 1
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_Users_remko_macports_ports_science_cdo/cdo/work/cdo-2.0.6/src'
:info:build make[1]: *** [all] Error 2
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_Users_remko_macports_ports_science_cdo/cdo/work/cdo-2.0.6/src'
:info:build make: *** [all-recursive] Error 1
:info:build make: Leaving directory `/opt/local/var/macports/build/_Users_remko_macports_ports_science_cdo/cdo/work/cdo-2.0.6'
:info:build Command failed:  cd "/opt/local/var/macports/build/_Users_remko_macports_ports_science_cdo/cdo/work/cdo-2.0.6" && /usr/bin/make -j8 -w all
:info:build Exit code: 2


Replies (17)

RE: cdo 2.0.6 fails to compile on Mac OS intel - Added by Remko Scharroo about 2 years ago

Log repeated here with proper formatting ...

:info:build libtool: link: /usr/bin/clang++ -std=gnu++17 -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch x86_64 -pthread -Wl,-headerpad_max_install_names -Wl,-rpath -Wl,/opt/local/lib/libgcc -Wl,-syslibroot -
Wl,/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch x86_64 -o cdo cdo-cdo.o cdo-Adisit.o cdo-Afterburner.o cdo-Arith.o cdo-Arithc.o cdo-Arithdays.o cdo-Arithlat.o cdo-Bitrounding.o cdo-Cat.o cdo-CDIread.o cdo-CDItest.o cdo-CDIwrite.o cdo-Change.o cdo-Change_e5slm.o cdo-Cloudlayer.o cdo-CMOR.o cdo-CMOR_lite.o cdo-CMOR_table.o cdo-Collgrid.o cdo-Command.o cdo-Comp.o cdo-Compc.o cdo-Complextorect.o cdo-Cond.o cdo-Cond2.o cdo-Condc.o cdo-Consecstat.o cdo-Copy.o cdo-DCW_util.o cdo-Dayarith.o cdo-Deltat.o cdo-Deltime.o cdo-Depth.o cdo-Derivepar.o cdo-Detrend.o cdo-Diff.o cdo-Distgrid.o cdo-Duplicate.o cdo-EOFs.o cdo-Eof3d.o cdo-EcaIndices.o cdo-EcaEtccdi.o cdo-Echam5ini.o cdo-Enlarge.o cdo-Enlargegrid.o cdo-Ensstat.o cdo-Ensstat3.o cdo-Ensval.o cdo-Eofcoeff.o cdo-Eofcoeff3d.o cdo-EstFreq.o cdo-Exprf.o cdo-FC.o cdo-Filedes.o cdo-Fillmiss.o cdo-Filter.o cdo-Fldrms.o cdo-Fldstat.o cdo-Fldstat2.o cdo-Fourier.o cdo-Gengrid.o cdo-Gradsdes.o cdo-Gridboxstat.o cdo-Gridcell.o cdo-Gridsearch.o cdo-Harmonic.o cdo-Hi.o cdo-Histogram.o cdo-Importamsr.o cdo-Importbinary.o cdo-Importcmsaf.o cdo-Importobs.o cdo-Importfv3grid.o cdo-Info.o cdo-Input.o cdo-Intgrid.o cdo-Intgridtraj.o cdo-Intlevel.o cdo-Intlevel3d.o cdo-Intntime.o cdo-Inttime.o cdo-Intyear.o cdo-Invert.o cdo-Invertlev.o cdo-Lic.o cdo-MapReduce.o cdo-Maskbox.o cdo-Mastrfu.o cdo-Math.o cdo-Merge.o cdo-Mergegrid.o cdo-Mergetime.o cdo-Merstat.o cdo-Monarith.o cdo-Mrotuv.o cdo-Mrotuvb.o cdo-NCL_wind.o cdo-Ninfo.o cdo-Nmldump.o cdo-Output.o cdo-Outputgmt.o cdo-Pack.o cdo-Pardup.o cdo-Pinfo.o cdo-Pressure.o cdo-Recttocomplex.o cdo-Regres.o cdo-Remap.o cdo-Remapweights.o cdo-Remapeta.o cdo-Remapstat.o cdo-Replace.o cdo-Replacevalues.o cdo-Rhopot.o cdo-Rotuv.o cdo-Runpctl.o cdo-Runstat.o cdo-Samplegrid.o cdo-Samplegridicon.o cdo-Seascount.o cdo-Seaspctl.o cdo-Seasstat.o cdo-Seasmonstat.o cdo-Selbox.o cdo-Selgridcell.o cdo-Select.o cdo-Selmulti.o cdo-Seloperator.o cdo-Selrec.o cdo-Selregion.o cdo-Selsurface.o cdo-Seltime.o cdo-Selvar.o cdo-Selyearidx.o cdo-Set.o cdo-Setattribute.o cdo-Setbox.o cdo-Setgrid.o cdo-Setgridcell.o cdo-Sethalo.o cdo-Setmiss.o cdo-Setpartab.o cdo-Setrcaname.o cdo-Settime.o cdo-Setzaxis.o cdo-Shiftxy.o cdo-Showinfo.o cdo-Showattribute.o cdo-Sinfo.o cdo-Smooth.o cdo-Sort.o cdo-Sorttimestamp.o cdo-Specinfo.o cdo-Spectral.o cdo-Spectrum.o cdo-Split.o cdo-Splitrec.o cdo-Splitsel.o cdo-Splittime.o cdo-Splityear.o cdo-Tee.o cdo-Templates.o cdo-Test.o cdo-Tests.o cdo-Timcount.o cdo-Timcumsum.o cdo-Timfill.o cdo-Timpctl.o cdo-Timselpctl.o cdo-Timselstat.o cdo-Timsort.o cdo-Timstat.o cdo-Timstat2.o cdo-Timstat3.o cdo-Tinfo.o cdo-Tocomplex.o cdo-Transpose.o cdo-Trend.o cdo-Trendarith.o cdo-Tstepcount.o cdo-Unpack.o cdo-Vargen.o cdo-Varrms.o cdo-Varsstat.o cdo-Vertintap.o cdo-Vertintgh.o cdo-Vertintml.o cdo-Vertintzs.o cdo-Vertstat.o cdo-Vertcum.o cdo-Vertwind.o cdo-Verifygrid.o cdo-Wct.o cdo-Wind.o cdo-WindTrans.o cdo-Writegrid.o cdo-Writerandom.o cdo-XTimstat.o cdo-Yeararith.o cdo-Yearmonstat.o cdo-Ydayarith.o cdo-Ydaypctl.o cdo-Ydaystat.o cdo-Ydrunpctl.o cdo-Ydrunstat.o cdo-Yhourarith.o cdo-Yhourstat.o cdo-Ymonarith.o cdo-Ymonpctl.o cdo-Ymonstat.o cdo-Yseaspctl.o cdo-Yseasstat.o cdo-Zonstat.o cdo-Maggraph.o cdo-Magplot.o cdo-Magvector.o cdo-template_parser.o cdo-results_template_parser.o cdo-magics_template_parser.o cdo-string_utilities.o cdo-cdo_magics_mapper.o -L/opt/local/lib -L/opt/local/lib/proj8/lib ./.libs/libcdo.a ../libcdi/src/.libs/libcdi.a ../src/lib/yac/.libs/libyac.a ../src/lib/gradsdes/.libs/libgradsdes.a -lhdf5 -lpng -lopenjpeg -lcurl -lproj -lfftw3 -leccodes -ludunits2 -lnetcdf -lhdf5_hl -lpthread -pthread
:info:build Undefined symbols for architecture x86_64:
:info:build "std::__1::enable_if<(is_move_constructible<double>::value) && (is_move_assignable<double>::value), void>::type std::__1::swap<double>(double&, double&)", referenced from:
:info:build cdo::fft(double*, double*, int, int) in libcdo.a(libcdo_la-cdo_fft.o)
:info:build ld: symbol(s) not found for architecture x86_64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:build make[2]: *** [cdo] Error 1
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_Users_remko_macports_ports_science_cdo/cdo/work/cdo-2.0.6/src'
:info:build make[1]: *** [all] Error 2
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_Users_remko_macports_ports_science_cdo/cdo/work/cdo-2.0.6/src'
:info:build make: *** [all-recursive] Error 1
:info:build make: Leaving directory `/opt/local/var/macports/build/_Users_remko_macports_ports_science_cdo/cdo/work/cdo-2.0.6'
:info:build Command failed: cd "/opt/local/var/macports/build/_Users_remko_macports_ports_science_cdo/cdo/work/cdo-2.0.6" && /usr/bin/make -j8 -w all
:info:build Exit code: 2

RE: cdo 2.0.6 fails to compile on Mac OS intel - Added by Remko Scharroo about 2 years ago

Hi Karen,
I'm afraid that is not an option. I'm trying to make the port of MacPorts.
Besides: it has functioned like this for many years. Something not entirely standard must have changed in the last release.

RE: cdo 2.0.6 fails to compile on Mac OS intel - Added by Karin Meier-Fleischer about 2 years ago

For the new CDO version new features of netCDF 4.9.0. are used. But I will ask Uwe and Ralf to have a look at your problem.

RE: cdo 2.0.6 fails to compile on Mac OS intel - Added by Estanislao Gavilan about 2 years ago

Hi Remko,

maybe there is an incompatibility between cdo and your netcdf libraries. Karin metioned that cdo 2.0.6 uses functions from Netcdf 4.9.0. Did you try to update your netcdf libraries to that version?

Kind regards,

Estanislao

RE: cdo 2.0.6 fails to compile on Mac OS intel - Added by Remko Scharroo about 2 years ago

I am already using NetCDF 4.9.0 and had already compiled cdo 2.0.5 with it successfully.
The error also shows that there is something inside the libcdo code, rather than its link to the NetCDF library:

:info:build Undefined symbols for architecture x86_64:
:info:build   "std::__1::enable_if<(is_move_constructible<double>::value) && (is_move_assignable<double>::value), void>::type std::__1::swap<double>(double&, double&)", referenced from:
:info:build       cdo::fft(double*, double*, int, int) in libcdo.a(libcdo_la-cdo_fft.o)

This may, of course, have something to do specifically with the compiler/linker,
$ /usr/bin/clang++ --version
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

RE: cdo 2.0.6 fails to compile on Mac OS intel - Added by Ralf Mueller about 2 years ago

Hi!

can you upload the config.log file? I wonder if your compile with -fPIC..

cheers
ralf

RE: cdo 2.0.6 fails to compile on Mac OS intel - Added by Yanchun He about 2 years ago

It is CDO 2.0.5 on Conda. Is there a plan to to release conda version for 2.0.6? Compiled with Magics is highly appreciated.

Thanks in advance!

Yanchun

Karin Meier-Fleischer wrote in RE: cdo 2.0.6 fails to compile on Mac OS intel:

Hi Remko,

I would recommend to install CDO with conda. See https://code.mpimet.mpg.de/projects/cdo/wiki/MacOS_Platform

RE: cdo 2.0.6 fails to compile on Mac OS intel - Added by Tancrede Leger about 2 years ago

Hi,

I have a problem linked to this issue of installing CDO: usually when installing packages like gdal or nco for instance I use conda
After creating an environment I'm trying to install CDO with conda using any of these commands:

conda install -c conda-forge cdo
conda install -c "conda-forge/label/cf202003" cdo
conda install -c "conda-forge/label/dev" cdo
conda install -c "conda-forge/label/gcc7" cdo
conda install -c "conda-forge/label/broken" cdo
conda install -c "conda-forge/label/cf201901" cdo

All of them produce the same error:

"Solving environment: failed with initial frozen solve. Retrying with flexible solve"

"The following packages are not available from current channels:

- cdo "

Is there something that I am doing completely wrong here?

Many thanks!

Tancrede

RE: cdo 2.0.6 fails to compile on Mac OS intel - Added by Ralf Mueller about 2 years ago

conda install -c conda-forge cdo should be sufficient. That's at least what I use to install.

the current 2.0.6 version handles exit codes a bit different which cause a test to fail (within the conda-forge building). that's why this version is not available, yet.

@Trancrede
Is your error happening on MacOS or Linux?

RE: cdo 2.0.6 fails to compile on Mac OS intel - Added by Tancrede Leger about 2 years ago

Hi Ralf,

Thanks for your reply,
Apologies I forgot to precise that I am using Linux.

Best wishes,

Tancrede

RE: cdo 2.0.6 fails to compile on Mac OS intel - Added by Karin Meier-Fleischer about 2 years ago

@Tancrede

Do you try to install CDO into an existing conda environment? When the dependencies of CDO are not fitting the environment's than it fails. Did you try to install CDO in a new envrironment?

conda create -n cdo_env -c conda-forge cdo

Does that fail, too?

RE: cdo 2.0.6 fails to compile on Mac OS intel - Added by Tancrede Leger about 2 years ago

Hi karin,

Yes indeed I had created a seperate new environment prior to attempting the install.
I just tried doing it using one single command as you suggested and the same error occurred.

Thanks in advance for your help,

Tancrede

RE: cdo 2.0.6 fails to compile on Mac OS intel - Added by Karin Meier-Fleischer about 2 years ago

Hm, that is strange.

Last try, can you create an empty environment

conda create -n testenv

and than activate the environment

conda activate testenv

and than install CDO within

conda install -c conda-forge CDO

Can you install any other package you have already installed in this testenv?

If that doesn't work you have to ask the conda community for help.

RE: cdo 2.0.6 fails to compile on Mac OS intel - Added by Tancrede Leger about 2 years ago

hmm, I'm a bit confused as well...

Just tried again with your suggestions and same error occured.
I also just tried installing NCO using conda in this environment and it worked fine.

tancrede

RE: cdo 2.0.6 fails to compile on Mac OS intel - Added by Uwe Schulzweida about 2 years ago

In src/cdo_fft.cc an include file is missing:

#include <algorithm> 
Unfortunately, the clang12 compiler has not noticed this.
We will fix this problem in the next release.

RE: cdo 2.0.6 fails to compile on Mac OS intel - Added by Remko Scharroo about 2 years ago

Thanks, Uwe. That did indeed made it compile to the end.
I've added this additional line as a patch for cdo 2.0.6 on macports.
I will remember to remove the patch when the next version comes out.

    (1-17/17)