Make error on FreeBSD13.1

ROOT Version: 6.26.06
Platform: FreeBSD13.1
Compiler: Clang 13.0.0


Hello, everyone. I encountered a problem when I was building the root source code from source.
I tried to search online, but it seemed that ROOT is not used much in FreeBSD environment.

I tried to build with cmake ../src, and everything was fine, after make command, it stopped the compilation with the following lines when the compilation was completed more than a half.
I used ROOT on some Linux distros, this was the 1st time I used it on UNIX, and it failed to build. hope you can help me with it, thank you.

Consolidate compiler generated dependencies of target rootcling_stage1
[ 72%] Built target rootcling_stage1
[ 72%] Generating G__Core.cxx, ../lib/Core.pcm
 #0 0x00000000044aaf65 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/home/cai/root/build/core/rootcling_stage1/src/rootcling_stage1+0x44aaf65)
 #1 0x00000000044a91b6 llvm::sys::RunSignalHandlers() (/home/cai/root/build/core/rootcling_stage1/src/rootcling_stage1+0x44a91b6)
 #2 0x00000000044ab726 SignalHandler(int) (/home/cai/root/build/core/rootcling_stage1/src/rootcling_stage1+0x44ab726)
 #3 0x0000000804b32580 (/lib/libthr.so.3+0x1a580)
 #4 0x0000000804b31b3f (/lib/libthr.so.3+0x19b3f)
 #5 0x00007ffffffff2d3 ([vdso]+0x2d3)
 #6 0x0000000804e8ee84 strlen (/lib/libc.so.7+0x157e84)
 #7 0x000000000161c729 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string<std::nullptr_t>(char const*) (/home/cai/root/build/core/rootcling_stage1/src/rootcling_stage1+0x161c729)
 #8 0x000000000161c673 GetEtcDir() (/home/cai/root/build/core/rootcling_stage1/src/rootcling_stage1+0x161c673)
 #9 0x0000000001686202 RootClingMain(int, char**, bool) (/home/cai/root/build/core/rootcling_stage1/src/rootcling_stage1+0x1686202)
#10 0x0000000001697075 ROOT_rootcling_Driver (/home/cai/root/build/core/rootcling_stage1/src/rootcling_stage1+0x1697075)
Stack dump:
0.	Program arguments: /home/cai/root/build/core/rootcling_stage1/src/rootcling_stage1 -v2 -f G__Core.cxx -cxxmodule -s /home/cai/root/build/lib/libCore.so -excludePath /home/cai/root/root-6.26.06 -excludePath /home/cai/root/build/ginclude -excludePath /home/cai/root/build/externals -excludePath /home/cai/root/build/builtins -writeEmptyRootPCM -m _Builtin_intrinsics -mByproduct _Builtin_intrinsics -mByproduct ROOT_Foundation_Stage1_NoRTTI -mByproduct ROOT_Foundation_C -mByproduct ROOT_Rtypes -D__STDC_NO_COMPLEX__ -D__COMPLEX_H__ -D_COMPLEX_H -D__CLANG_STDATOMIC_H -compilerI/usr/include/c++/v1 -compilerI/usr/lib/clang/13.0.0/include -compilerI/usr/include -compilerI/usr/lib/clang/13.0.0/include -compilerI/usr/include -I/home/cai/root/build/include -I/home/cai/root/build/ginclude -I/home/cai/root/root-6.26.06/core/base/inc -I/home/cai/root/root-6.26.06/core/foundation/inc -I/home/cai/root/root-6.26.06/core/cont/inc -I/home/cai/root/root-6.26.06/core/gui/inc -I/home/cai/root/root-6.26.06/core/meta/inc -I/home/cai/root/root-6.26.06/core/clib/inc -I/home/cai/root/root-6.26.06/core/rint/inc -I/home/cai/root/root-6.26.06/core/zip/inc -I/home/cai/root/root-6.26.06/core/thread/inc -I/home/cai/root/root-6.26.06/core/textinput/inc -I/home/cai/root/root-6.26.06/core/clingutils/inc -I/home/cai/root/root-6.26.06/core/base/v7/inc -I/home/cai/root/root-6.26.06/core/foundation/v7/inc -I/home/cai/root/root-6.26.06/core/unix/inc -I/usr/local/include -I/usr/include ROOT/TErrorDefaultHandler.hxx ROOT/TSequentialExecutor.hxx ROOT/StringConv.hxx Buttons.h Bytes.h Byteswap.h KeySymbols.h MessageTypes.h Riostream.h Rtypes.h TApplication.h TAtt3D.h TAttAxis.h TAttBBox2D.h TAttBBox.h TAttFill.h TAttLine.h TAttMarker.h TAttPad.h TAttText.h TBase64.h TBenchmark.h TBuffer3D.h TBuffer3DTypes.h TBuffer.h TColor.h TColorGradient.h TDatime.h TDirectory.h TEnv.h TException.h TExec.h TFileCollection.h TFileInfo.h TFolder.h TInetAddress.h TMacro.h TMathBase.h TMD5.h TMemberInspector.h TMessageHandler.h TNamed.h TNotifyLink.h TObject.h TObjString.h TParameter.h TPluginManager.h TPoint.h TPRegexp.h TProcessID.h TProcessUUID.h TQClass.h TQCommand.h TQConnection.h TQObject.h TRedirectOutputGuard.h TRefCnt.h TRef.h TRegexp.h TRemoteObject.h TROOT.h TRootIOCtor.h TStopwatch.h TStorage.h TString.h TStringLong.h TStyle.h TSysEvtHandler.h TSystemDirectory.h TSystemFile.h TSystem.h TTask.h TThreadSlots.h TTime.h TTimer.h TTimeStamp.h TUri.h TUrl.h TUUID.h TVersionCheck.h TVirtualAuth.h TVirtualFFT.h TVirtualGL.h TVirtualMonitoring.h TVirtualMutex.h TVirtualPadEditor.h TVirtualPad.h TVirtualPadPainter.h TVirtualPerfStats.h TVirtualPS.h TVirtualQConnection.h TVirtualRWMutex.h TVirtualTableInterface.h TVirtualViewer3D.h TVirtualX.h strlcpy.h snprintf.h strtok.h ROOT/TSeq.hxx TArrayC.h TArrayD.h TArrayF.h TArray.h TArrayI.h TArrayL64.h TArrayL.h TArrayS.h TBits.h TBtree.h TClassTable.h TClonesArray.h TCollection.h TCollectionProxyInfo.h TExMap.h THashList.h THashTable.h TIterator.h TList.h TMap.h TObjArray.h TObjectTable.h TOrdCollection.h TRefArray.h TRefTable.h TSeqCollection.h TSortedList.h TVirtualCollectionProxy.h ESTLType.h RStringView.h TClassEdit.h TError.h ROOT/RLogger.hxx ROOT/RNotFn.hxx ROOT/RRangeCast.hxx ROOT/RSpan.hxx ROOT/RStringView.hxx ROOT/StringUtils.hxx ROOT/span.hxx ROOT/TypeTraits.hxx TUnixSystem.h root_std_complex.h GuiTypes.h TApplicationImp.h TBrowser.h TBrowserImp.h TCanvasImp.h TClassMenuItem.h TContextMenu.h TContextMenuImp.h TControlBarImp.h TGuiFactory.h TInspectorImp.h TObjectSpy.h TToggleGroup.h TToggle.h TBaseClass.h TClassGenerator.h TClass.h TClassRef.h TClassStreamer.h TDataMember.h TDataType.h TDictAttributeMap.h TDictionary.h TEnumConstant.h TEnum.h TFileMergeInfo.h TFunction.h TFunctionTemplate.h TGenericClassInfo.h TGlobal.h TInterpreter.h TInterpreterValue.h TIsAProxy.h TListOfDataMembers.h TListOfEnums.h TListOfEnumsWithLock.h TListOfFunctions.h TListOfFunctionTemplates.h TMemberStreamer.h TMethodArg.h TMethodCall.h TMethod.h TProtoClass.h TRealData.h TSchemaHelper.h TSchemaRule.h TSchemaRuleSet.h TStatusBitsChecker.h TStreamerElement.h TStreamer.h TVirtualIsAProxy.h TVirtualRefProxy.h TVirtualStreamerInfo.h TVirtualArray.h TVirtualObject.h Getline.h /home/cai/root/root-6.26.06/core/base/inc/LinkDef.h 
Segmentation fault
*** Error code 1

Stop.
make[2]: stopped in /usr/home/cai/root/build
*** Error code 1

Stop.
make[1]: stopped in /usr/home/cai/root/build
*** Error code 1

Stop.
make: stopped in /usr/home/cai/root/build

Hi @caid,

I have never built ROOT on FreeBSD, but according to the stack trace and taking a look to the implementation of GetEtcDir() in core/rootcling_stage1/src/rootcling_stage1.cxx, I assume that the ROOTSYS environment variable is not set at that time.

Cheers,
J.

@jalopezg Thank you very much for your reply.

I built ROOT in Linux in the same way as I did in FreeBSD, and no error happened.

And I set these three environment variables:

 export ROOTSYS=/usr/local
 export PATH=$ROOTSYS/bin:$PATH
 export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH

and re-ran commands:

cmake ../src
make

and now the error changed, it seems that there are some library missed in my file system, see below in details, any help would be appreciated:

onsolidate compiler generated dependencies of target rootcling_stage1
[ 73%] Built target rootcling_stage1
[ 73%] Generating G__Core.cxx, ../lib/Core.pcm
ERROR in cling::CIFactory::createCI():
  resource directory /usr/local/etc/cling/lib/clang/9.0.1 not found!
fatal error: module map file '/home/cai/root/build/core/rootcling_stage1/lib/clang/9.0.1/include/module.modulemap' not found
fatal error: module map file '/home/cai/root/build/core/rootcling_stage1/lib/clang/9.0.1/include/module.modulemap' not found
fatal error: module map file '/home/cai/root/build/core/rootcling_stage1/lib/clang/9.0.1/include/module.modulemap' not found
Warning in cling::IncrementalParser::CheckABICompatibility():
  Failed to extract C++ standard library version.
Warning in cling::IncrementalParser::CheckABICompatibility():
  Possible C++ standard library mismatch, compiled with _LIBCPP_ABI_VERSION '1'
  Extraction of runtime standard library version was: ''
Error: Module '_Builtin_intrinsics' failed to load.
In file included from input_line_3:2:
In file included from /home/cai/root/build/include/Rtypes.h:28:
/home/cai/root/build/include/strtok.h:14:11: error: use of undeclared identifier 'strtok_r'
   return strtok_r(str, delim, saveptr);
          ^
In file included from input_line_3:2:
In file included from /home/cai/root/build/include/Rtypes.h:29:
In file included from /home/cai/root/build/include/strlcpy.h:17:
In file included from /usr/include/unistd.h:39:
In file included from /usr/include/sys/types.h:46:
In file included from /usr/include/machine/endian.h:6:
In file included from /usr/include/x86/endian.h:38:
/usr/include/sys/_types.h:97:26: error: cannot combine with previous 'type-name' declaration specifier
typedef __uint_least16_t __char16_t;
                         ^
/usr/include/sys/_types.h:98:26: error: cannot combine with previous 'type-name' declaration specifier
typedef __uint_least32_t __char32_t;
                         ^
/usr/include/sys/_types.h:107:24: error: expected ';' at end of declaration list
        long long __max_align1 __aligned(_Alignof(long long));
                              ^
/usr/include/sys/_types.h:109:26: error: expected ';' at end of declaration list
        long double __max_align2 __aligned(_Alignof(long double));
                                ^
/usr/include/sys/_types.h:135:2: error: "No support for your compiler for stdargs"
#error "No support for your compiler for stdargs"
 ^
In file included from input_line_3:2:
In file included from /home/cai/root/build/include/Rtypes.h:30:
In file included from /home/cai/root/build/include/snprintf.h:14:
/usr/include/c++/v1/stdio.h:101:10: fatal error: could not build module 'std_config'
#include <__config>
 ~~~~~~~~^
Error: Error loading the default rootcling header files.
*** Error code 1

Stop.
make[2]: stopped in /usr/home/cai/root/build
*** Error code 1

Stop.
make[1]: stopped in /usr/home/cai/root/build
*** Error code 1

Stop.
make: stopped in /usr/home/cai/root/build

I guess that during build, this should point to the ROOT build directory instead. Otherwise, some files will be picked up from the wrong place (see below).

The question to me is whether there are any other users having the same problem when building on FreeBSD - on a quick search on the forum, I didn’t find anyone else with the same issue.

Cheers,
J.

We know that our way of having rootcling / rootcling_stage1 determine and export ROOTSYS doesn’t work on FreeBSD. We never got around to debugging and fixing this; I’d be happy to see a patch for it!

Add ENABLE_EXPORTS to rootcling by bellenot · Pull Request #11579 · root-project/root · GitHub might help with the issue of “am I rootcling”.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.