[unable to compile and link C++ code with g++ 12.3]

Maxim Abalenkov maxim.abalenkov at gmail.com
Wed Sep 20 16:56:54 UTC 2023


Dear Dave et al.,

I’m unable to run the ‘xcodebuild —version’. It complains:

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

The version of Xcode reported by the ‘About Xcode’ graphical menu item is:

Version 15.0 (15A240d)

—
Best wishes,
Maxim

Maxim Abalenkov \\ maxim.abalenkov at gmail.com
+44 7 486 486 505 \\ www.maxim.abalenkov.uk

> On 20 Sep 2023, at 17:41, Dave Allured - NOAA Affiliate <dave.allured at noaa.gov> wrote:
> 
> Maxim, thank you for the detailed follow-up.  What is the full output from "xcodebuild -version"?
> 
> 
> On Wed, Sep 20, 2023 at 10:36 AM Maxim Abalenkov <maxim.abalenkov at gmail.com <mailto:maxim.abalenkov at gmail.com>> wrote:
>> Dear all,
>> 
>> I can compile and link the code with Clang C++ compiler from the MacPorts collection:
>> 
>> clang version 15.0.7
>> Target: x86_64-apple-darwin22.6.0
>> Thread model: posix
>> InstalledDir: /opt/local/libexec/llvm-15/bin
>> 
>> To complement my previous email: my target system is macOS 13.5.2 (22G91) and the new command line tools version is:
>> 
>> package-id: com.apple.pkg.CLTools_Executables
>> version: 15.0.0.0.1.1694021235
>> volume: /
>> location: /
>> install-time: 1695112544
>> 
>>>> Best wishes,
>> Maxim
>> 
>>> On 20 Sep 2023, at 17:11, Maxim Abalenkov <maxim.abalenkov at gmail.com <mailto:maxim.abalenkov at gmail.com>> wrote:
>>> 
>>> Dear all,
>>> 
>>> How are you? I hope all is well with you. I need help please. I’m no longer able to compile and link a C++ code on my Mac. I use the latest GNU C++ compiler available via MacPorts:
>>> 
>>> g++ (MacPorts gcc12 12.3.0_0+stdlib_flag) 12.3.0
>>> 
>>> Please find below the output of the make tool:
>>> 
>>> g++ ifm.o Core/engine.o Core/filter.o Core/watershed.o FileIO/interpolation.o FileIO/mapfile.o FileIO/netcdf_io.o FileIO/rain_table.o -o ifm -fopenmp -O3   -lm -lz -lnetcdf_c++ -lnetcdf -L/opt/local/lib
>>> -macosx_version_min has been renamed to -macos_version_min
>>> 0  0x109822f43  __assert_rtn + 64
>>> 1  0x109724f43  ld::AtomPlacement::findAtom(unsigned char, unsigned long long, ld::AtomPlacement::AtomLoc const*&, long long&) const + 1411
>>> 2  0x109741431  ld::InputFiles::SliceParser::parseObjectFile(mach_o::Header const*) const + 19745
>>> 3  0x109751b71  ld::InputFiles::parseAllFiles(void (ld::AtomFile const*) block_pointer)::$_7::operator()(unsigned long, ld::FileInfo const&) const + 657
>>> 4  0x7ff810954066  _dispatch_client_callout2 + 8
>>> 5  0x7ff810965e09  _dispatch_apply_invoke + 213
>>> 6  0x7ff810954033  _dispatch_client_callout + 8
>>> 7  0x7ff8109640f6  _dispatch_root_queue_drain + 683
>>> 8  0x7ff810964768  _dispatch_worker_thread2 + 170
>>> 9  0x7ff810af1c0f  _pthread_wqthread + 257
>>> ld: Assertion failed: (resultIndex < sectData.atoms.size()), function findAtom, file Relocations.cpp, line 1336.
>>> collect2: error: ld returned 1 exit status
>>> make: *** [Makefile:58: ifm] Error 1
>>> 
>>> All this may be related to the update of Xcode command line tools that I performed yesterday. Any help on how to debug and make it compile would be most welcome. Thank you and have a great day ahead!
>>> 
>>>>>> Best wishes,
>>> Maxim
>>> 
>>> Maxim Abalenkov \\ maxim.abalenkov at gmail.com <mailto:maxim.abalenkov at gmail.com>
>>> +44 7 486 486 505 \\ www.maxim.abalenkov.uk <http://www.maxim.abalenkov.uk/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20230920/cc45e365/attachment.htm>


More information about the macports-users mailing list