Problem 2012

Summary: Compiling Geant4 breaks down with too many objects
Product: Geant4 Reporter: Yingchao Lu <yingchao.lu>
Component: cmakeAssignee: Ben Morgan <Ben.Morgan>
Status: CLOSED WORKSFORME    
Severity: normal CC: yingchao.lu
Priority: P3    
Version: 10.3   
Hardware: PC   
OS: Windows   
Attachments: Cmake cache
Output

Description Yingchao Lu 2017-11-09 05:12:52 CET
On windows10, using VC 2015, I got similar error to the post on the forum:

http://hypernews.slac.stanford.edu/HyperNews/geant4/get/installconfig/1778.html?inline=-1

I did not use debug config, but release config instead

cmake.exe --build . --config Release

, according to

http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/html/ch02s02.html

The error I got:


[ 80%] Linking CXX shared library ..\..\BuildProducts\bin\G4processes.dll 
LINK: command "C:\PROGRA~2\MICROS~1.0\VC\bin\link.exe /nologo @CMakeFiles\G4processes.dir\objects1.rsp /out:..\..\BuildProducts\bin\G4processes.dll /implib:..\..\BuildProducts\lib\G4processes.lib /pdb:C:\Users\yingc\source\Geant4\build-geant4_10_03_p03-Desktop_Qt_5_9_2_MSVC2015_32bit-Release\BuildProducts\bin\G4processes.pdb /dll /version:0.0 /machine:X86 /INCREMENTAL:NO /DEF:_G4processes-..def ..\..\BuildProducts\lib\_G4processes-archive.lib ..\..\BuildProducts\lib\G4digits_hits.lib ..\..\BuildProducts\lib\G4track.lib ..\..\BuildProducts\lib\G4expat.lib ..\..\BuildProducts\lib\G4zlib.lib ..\..\BuildProducts\lib\G4particles.lib ..\..\BuildProducts\lib\G4geometry.lib ..\..\BuildProducts\lib\G4materials.lib ..\..\BuildProducts\lib\G4graphics_reps.lib ..\..\BuildProducts\lib\G4intercoms.lib ..\..\BuildProducts\lib\G4global.lib ..\..\BuildProducts\lib\G4clhep.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:..\..\BuildProducts\bin\G4processes.dll.manifest" failed (exit code 1189) with the following output: 
LINK : fatal error LNK1189: library limit of 65535 objects exceeded 
NMAKE : fatal error U1077: '"C:\Program Files (x86)\CMake\bin\cmake.exe"' : return code '0xffffffff' 
Stop. 
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2' 
Stop. 
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2' 
Stop. 

I used the latest version 10.3 patch-03
Comment 1 Ben Morgan 2017-11-22 18:29:22 CET
Could you post the exact configuration you passed to CMake before building please? 

Could you also try building using

cmake.exe --build . --config RelWithDebInfo

This is the configuration tested on CI without, so it's possible something has changed that would not affect that mode, or that there are additional options that are causing the issue (hence the first question).
Comment 2 Yingchao Lu 2017-12-04 00:14:19 CET
Created attachment 475 [details]
Cmake cache

Attached is the cmake cache that I use.
Comment 3 Yingchao Lu 2017-12-04 05:35:55 CET
Created attachment 476 [details]
Output

I tried using

cmake.exe --build . --config RelWithDebInfo

And the same error appeared.
Comment 4 Ben Morgan 2018-05-08 14:32:22 CEST
Could you retry this with Geant4 10.4 and latest CMake please? There should be improvements to the build of DLLs and CMake's handling of these.
Comment 5 Ben Morgan 2018-07-06 09:32:13 CEST
Marking as CLOSED. Please reopen if required with requested information.