[SERVER-47314] compiler version not change in scons on OpenBSD Created: 03/Apr/20  Updated: 06/Feb/23  Resolved: 06/Feb/23

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Abolfazl Ziaratban Assignee: [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive)
Resolution: Won't Do Votes: 0
Labels: sdp-backlog-purge
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Server Development Platform
Operating System: ALL
Steps To Reproduce:

 

after install any requirements :

buildscripts/scons.py MONGO_VERSION=4.3.5 -j4 --d --cc=egcc --cxx=eg++ --disable-warnings-as-errors --ssl=off mongod mongo

output

scons version: 3.1.2
python version: 3 7 4 'final' 0
CC is gcc
gcc found in $PATH at /usr/bin/gcc
CXX is g++
g++ found in $PATH at /usr/bin/g++
Checking whether the C compiler works... yes
Checking whether the C++ compiler works... yes
Checking that the C++ compiler can link a C++ program... yes
Checking if C++ compiler "g++" is GCC... yes
Checking if C compiler "gcc" is GCC... yes
Detected a x86_64 processor
Checking if target OS openbsd is supported by the toolchain... yes
Checking if C compiler is GCC 8.2 or newer...no
Checking if C++ compiler is GCC 8.2 or newer...no
ERROR: Refusing to build with compiler that does not meet requirements
See /home/mongo-r4.3.5/build/scons/config.log for details

scons/config.log

file /home/mongo-r4.3.5/SConstruct,line 1300:
	Configure(confdir = build/scons/opt/sconf_temp)
scons: Configure: Checking whether the C compiler works... 
build/scons/opt/sconf_temp/conftest_737c003a897167642b70f8cdde8a0eaf_0.c <-
  |
  |int main(void)
  |{
  |    return 0;
  |}
  |
gcc -o build/scons/opt/sconf_temp/conftest_737c003a897167642b70f8cdde8a0eaf_0_4e018b83dbae4a564d3abaec0d4c8465.o -c build/scons/opt/sconf_temp/conftest_737c003a897167642b70f8cdde8a0eaf_0.c
scons: Configure: yes
 
scons: Configure: Checking whether the C++ compiler works... 
build/scons/opt/sconf_temp/conftest_737c003a897167642b70f8cdde8a0eaf_1.cpp <-
  |
  |int main(void)
  |{
  |    return 0;
  |}
  |
g++ -o build/scons/opt/sconf_temp/conftest_737c003a897167642b70f8cdde8a0eaf_1_f4c6a764e80b6d2f336f5311c617b0d0.o -c build/scons/opt/sconf_temp/conftest_737c003a897167642b70f8cdde8a0eaf_1.cpp
scons: Configure: yes
 
scons: Configure: Checking that the C++ compiler can link a C++ program... 
build/scons/opt/sconf_temp/conftest_ac30bfea77045c1c67c4f51773b51414_0.cpp <-
  |
  |#include <iostream>
  |#include <cstdlib>
  |
  |int main() {
  |    std::cout << "Hello, World" << std::endl;
  |    return EXIT_SUCCESS;
  |}
  |
g++ -o build/scons/opt/sconf_temp/conftest_ac30bfea77045c1c67c4f51773b51414_0.o -c build/scons/opt/sconf_temp/conftest_ac30bfea77045c1c67c4f51773b51414_0.cpp
g++ -o build/scons/opt/sconf_temp/conftest_ac30bfea77045c1c67c4f51773b51414_0_fb048025625fc91381d082d9ffbfb5b5 build/scons/opt/sconf_temp/conftest_ac30bfea77045c1c67c4f51773b51414_0.o
scons: Configure: yes
 
scons: Configure: Checking if C++ compiler "g++" is GCC... 
build/scons/opt/sconf_temp/conftest_4f0e9b4472e273623d18770138ab2253_0.cpp <-
  |
  |#if defined(__GNUC__) && !defined(__clang__)
  |/* we are using toolchain defined(__GNUC__) && !defined(__clang__) */
  |#else
  |#error
  |#endif
  |
g++ -o build/scons/opt/sconf_temp/conftest_4f0e9b4472e273623d18770138ab2253_0_a53f49f0a5b49d3a1930add1c669ff5d.o -c build/scons/opt/sconf_temp/conftest_4f0e9b4472e273623d18770138ab2253_0.cpp
scons: Configure: yes
 
scons: Configure: Checking if C compiler "gcc" is GCC... 
build/scons/opt/sconf_temp/conftest_4f0e9b4472e273623d18770138ab2253_1.c <-
  |
  |#if defined(__GNUC__) && !defined(__clang__)
  |/* we are using toolchain defined(__GNUC__) && !defined(__clang__) */
  |#else
  |#error
  |#endif
  |
gcc -o build/scons/opt/sconf_temp/conftest_4f0e9b4472e273623d18770138ab2253_1_ea0252cf890ba84f7517f6fab562dbfd.o -c build/scons/opt/sconf_temp/conftest_4f0e9b4472e273623d18770138ab2253_1.c
scons: Configure: yes
 
build/scons/opt/sconf_temp/conftest_88c70ef45b935cd9e8e481913b1c9792_0.c <-
  |
  |#if defined(__arm__)
  |/* Detected arm */
  |#else
  |#error not arm
  |#endif
  |
gcc -o build/scons/opt/sconf_temp/conftest_88c70ef45b935cd9e8e481913b1c9792_0_56b3766c230d14b22692a2e42ffc5229.o -c build/scons/opt/sconf_temp/conftest_88c70ef45b935cd9e8e481913b1c9792_0.c
build/scons/opt/sconf_temp/conftest_88c70ef45b935cd9e8e481913b1c9792_0.c:5:2: error: #error not arm
build/scons/opt/sconf_temp/conftest_aa9c0ec15eb67315005e48c7142d5763_0.c <-
  |
  |#if defined(__arm64__) || defined(__aarch64__)
  |/* Detected aarch64 */
  |#else
  |#error not aarch64
  |#endif
  |
gcc -o build/scons/opt/sconf_temp/conftest_aa9c0ec15eb67315005e48c7142d5763_0_4907f655c8dbe62d40c4d0e3b5d4b442.o -c build/scons/opt/sconf_temp/conftest_aa9c0ec15eb67315005e48c7142d5763_0.c
build/scons/opt/sconf_temp/conftest_aa9c0ec15eb67315005e48c7142d5763_0.c:5:2: error: #error not aarch64
build/scons/opt/sconf_temp/conftest_067efcd68b39191f21773501607a9c8e_0.c <-
  |
  |#if defined(__i386) || defined(_M_IX86)
  |/* Detected i386 */
  |#else
  |#error not i386
  |#endif
  |
gcc -o build/scons/opt/sconf_temp/conftest_067efcd68b39191f21773501607a9c8e_0_d874f0935a66606de8e5f3cd15acdcd5.o -c build/scons/opt/sconf_temp/conftest_067efcd68b39191f21773501607a9c8e_0.c
build/scons/opt/sconf_temp/conftest_067efcd68b39191f21773501607a9c8e_0.c:5:2: error: #error not i386
build/scons/opt/sconf_temp/conftest_c0b1d7f6a7951557b08b1879d2707012_0.c <-
  |
  |#if defined(__powerpc64__)
  |/* Detected ppc64le */
  |#else
  |#error not ppc64le
  |#endif
  |
gcc -o build/scons/opt/sconf_temp/conftest_c0b1d7f6a7951557b08b1879d2707012_0_b03372b9b60e0f4472112644b94166bc.o -c build/scons/opt/sconf_temp/conftest_c0b1d7f6a7951557b08b1879d2707012_0.c
build/scons/opt/sconf_temp/conftest_c0b1d7f6a7951557b08b1879d2707012_0.c:5:2: error: #error not ppc64le
build/scons/opt/sconf_temp/conftest_6732939b06375ebbd46b5e264f3adb2e_0.c <-
  |
  |#if defined(__x86_64) || defined(_M_AMD64)
  |/* Detected x86_64 */
  |#else
  |#error not x86_64
  |#endif
  |
gcc -o build/scons/opt/sconf_temp/conftest_6732939b06375ebbd46b5e264f3adb2e_0_750e5292f9cc0aa3a08058bf9313e042.o -c build/scons/opt/sconf_temp/conftest_6732939b06375ebbd46b5e264f3adb2e_0.c
scons: Configure: Detected a x86_64 processor
 
scons: Configure: Checking if target OS openbsd is supported by the toolchain... 
build/scons/opt/sconf_temp/conftest_613421ebbfe8385e1a2f5e967e179457_0.c <-
  |
  |#if defined(__APPLE__)
  |#include <TargetConditionals.h>
  |#endif
  |#if defined(__OpenBSD__)
  |/* detected openbsd */
  |#else
  |#error
  |#endif
  |
gcc -o build/scons/opt/sconf_temp/conftest_613421ebbfe8385e1a2f5e967e179457_0_d1c28ea2c0ebdf26a0347f9a123b4526.o -c build/scons/opt/sconf_temp/conftest_613421ebbfe8385e1a2f5e967e179457_0.c
scons: Configure: yes
 
 
file /home/mongo-r4.3.5/SConstruct,line 2228:
	Configure(confdir = build/scons/opt/sconf_temp)
scons: Configure: Checking if C compiler is GCC 8.2 or newer...
build/scons/opt/sconf_temp/conftest_fe605161eb05ed15a28dad50dd5c2d3a_0.c <-
  |
  |#if !defined(__GNUC__) || defined(__clang__)
  |#error
  |#endif
  |
  |#if (__GNUC__ < 8) || (__GNUC__ == 8 && __GNUC_MINOR__ < 2)
  |#error GCC 8.2 or newer is required to build MongoDB
  |#endif
  |
  |int main(int argc, char* argv[]) {
  |    return 0;
  |}
  |
Compiling build/scons/opt/sconf_temp/conftest_fe605161eb05ed15a28dad50dd5c2d3a_0_b43c784ef1c4af62a5fb20c3947ce1d6.o
build/scons/opt/sconf_temp/conftest_fe605161eb05ed15a28dad50dd5c2d3a_0.c:7:2: error: #error GCC 8.2 or newer is required to build MongoDB
scons: Configure: no
 
scons: Configure: Checking if C++ compiler is GCC 8.2 or newer...
build/scons/opt/sconf_temp/conftest_fe605161eb05ed15a28dad50dd5c2d3a_1.cpp <-
  |
  |#if !defined(__GNUC__) || defined(__clang__)
  |#error
  |#endif
  |
  |#if (__GNUC__ < 8) || (__GNUC__ == 8 && __GNUC_MINOR__ < 2)
  |#error GCC 8.2 or newer is required to build MongoDB
  |#endif
  |
  |int main(int argc, char* argv[]) {
  |    return 0;
  |}
  |
Compiling build/scons/opt/sconf_temp/conftest_fe605161eb05ed15a28dad50dd5c2d3a_1_f4a5f31a5fc1ca8177787fe1e36f2441.o
build/scons/opt/sconf_temp/conftest_fe605161eb05ed15a28dad50dd5c2d3a_1.cpp:7:2: error: #error GCC 8.2 or newer is required to build MongoDB
scons: Configure: no

[1]: https://github.com/mongodb/mongo/wiki/Build-Mongodb-From-Source

Participants:

 Description   

i want compile mongodb from source in OpenBSD 6.6

according this link we must be changed compiler version in scons parameters but this parameters has not effect.



 Comments   
Comment by Andrew Morrow (Inactive) [ 20/Apr/20 ]

Thanks abolfazl.ziaratban@gmail.com for calling our attention to the misleading documentation, which we will undertake to improve. One issue is that the github wiki doesn't track branches, so the information it contains becomes outdated quickly. The building.md file is per-branch which means it is more likely to properly reflect the the current best practice for any given branch. For now, I am going to close this ticket and we will work to get the documentation improved.

Comment by Kelsey Schubert [ 06/Apr/20 ]

Thanks for the report and follow up, abolfazl.ziaratban@gmail.com! We'll take a look at whether we can improve our wiki.

Comment by Abolfazl Ziaratban [ 04/Apr/20 ]

this problem is solved

 

https://stackoverflow.com/questions/61006603/compiler-version-not-change-in-scons-on-openbsd-6-6#comment107949717_61006603

 

this is not bug but is a invalid doc on [this link|https://github.com/mongodb/mongo/wiki/Build-Mongodb-From-Source.]

On OpenBSD 5.4 or later, you will need to install gcc from ports (lang/gcc) or by using pkg_add You will also need to install devel/libexecinfo.

When you run SCons, you will also need to pass additional arguments to scons to use the compiler from ports instead of the system compiler, i.e. --cc=egcc --cxx=eg++.

*

 

Thanks.

Generated at Thu Feb 08 05:13:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.