Scl enable devtoolset-7 bash on Rocky 9

I didn’t find scl or devtoolset-7 to install. How should I do?
Thank you very much.

Install scl-utils if you want the scl command. But, you will not find devtoolset-7. The most you will find scl wise is gcc-toolset-* packages, which are all newer than the provided gcc in Rocky Linux 8 and 9.

If you are trying to install gcc 7 and its components, you will not be able to. It’s not supported.

1 Like

I would like to build the LLVM 8.0.0 with the ‘make -j 4’ command, now I’m stuck at 4%. What should I replace ’ scl enable devtoolset-7 bash’ command?
Thank you very much.

LLVM 8? Rocky 9 has llvm-14 (and also 11, 12, and 13 in EPEL).
If those numbers are intuitive, then the 8 is ancient (just like GCC 7).

What makes you think that you do need something old, that you have to build from sources, and that you can’t use current development tools for that?

You do mention two “commands”. I get a feel that you do follow some “old guide” and copy-paste lines from it. Guides do get old. Some were never good. One has to adapt and for that understand what is done and why.

1 Like

I see the LLVM 8 need to build by ‘make -j 4’ command, does llvm-14 also need this command? Now, I’m stuck at the 4% building, how should I do?

Building Log:

[  4%] Linking CXX static library ../libLLVMSupport.a
make[2]: Leaving directory '/home/nb193/llvm-8.0.0/build-8.0.0'
[  4%] Built target LLVMSupport
make[1]: Leaving directory '/home/nb193/llvm-8.0.0/build-8.0.0'
make: *** [Makefile:152: all] Error 2


gmake[1]: *** [CMakeFiles/cmTC_a50a4.dir/build.make:66: CMakeFiles/cmTC_a50a4.dir/src.cxx.o] Error 1
gmake[1]: Leaving directory '/home/nb193/llvm-8.0.0/build-8.0.0/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:126: cmTC_a50a4/fast] Error 2

Source file was:
int main() { return 0; }


/usr/bin/c++   -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections  -std=c++11  -Wall  -Wextra  -Wshadow  -pedantic  -pedantic-errors  -Wfloat-equal  -fstrict-aliasing  -fno-exceptions  -Wstrict-aliasing -DHAVE_CXX_FLAG_COVERAGE  --coverage   -Wl,-allow-shlib-undefined  -rdynamic CMakeFiles/cmTC_fbd62.dir/src.cxx.o  -o cmTC_fbd62 -lm 
gmake[1]: Leaving directory '/home/nb193/llvm-8.0.0/build-8.0.0/CMakeFiles/CMakeTmp'

Source file was:
int main() { return 0; }

I already installed:

And already used ‘scl enable gcc-toolset-12 bash’ command, but I still stuck at 4% building.
Thank you very much.

You did not answer my question. Why do you want to have llvm?

1 Like

I’m use the instruction from the parent company, then build in my country. However, need to change from RHL to free version (Rocky9). From my understanding, because they use c language in the web app, so need to use llvm to use c language in the browser.

CMakeError.log Line 573:

Run Build Command:"/usr/bin/gmake" "cmTC_a50a4/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_a50a4.dir/build.make CMakeFiles/cmTC_a50a4.dir/build
gmake[1]: Entering directory '/home/nb193/llvm-8.0.0/build-8.0.0/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_a50a4.dir/src.cxx.o
/usr/bin/c++    -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections  -std=c++11  -Wall  -Wextra  -Wshadow  -pedantic  -pedantic-errors  -Wfloat-equal  -fstrict-aliasing  -fno-exceptions  -Wstrict-aliasing -DHAVE_CXX_FLAG_WTHREAD_SAFETY  -Wthread-safety   -Wthread-safety -o CMakeFiles/cmTC_a50a4.dir/src.cxx.o -c /home/nb193/llvm-8.0.0/build-8.0.0/CMakeFiles/CMakeTmp/src.cxx
c++: error: unrecognized command-line option '-Wthread-safety'
c++: error: unrecognized command-line option '-Wthread-safety'

Thank you very much.

You won’t get an older llvm nor older gcc, cmake, etc on Rocky Linux 9. It just isn’t going to happen. And even if you do, it’s not supported. There’s very little reason to use obsoleted compiler software. Use the default llvm/gcc packages provided by Rocky Linux. Beyond that, you should research the errors at this point and try to resolve where your issues lie.

1 Like

And already changed complier from c++ to g++, it still error:

Run Build Command:"/usr/bin/gmake" "cmTC_94535/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_94535.dir/build.make CMakeFiles/cmTC_94535.dir/build
gmake[1]: Entering directory '/home/nb193/llvm-8.0.0/build-8.0.0/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_94535.dir/src.cxx.o
/opt/rh/gcc-toolset-12/root/usr/bin/g++    -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment  -std=c++11  -Wall  -Wextra  -Wshadow  -pedantic  -pedantic-errors  -Wfloat-equal  -fstrict-aliasing  -fno-exceptions  -Wstrict-aliasing -DHAVE_CXX_FLAG_WTHREAD_SAFETY  -Wthread-safety   -Wthread-safety -o CMakeFiles/cmTC_94535.dir/src.cxx.o -c /home/nb193/llvm-8.0.0/build-8.0.0/CMakeFiles/CMakeTmp/src.cxx
g++: error: unrecognized command-line option '-Wthread-safety'
g++: error: unrecognized command-line option '-Wthread-safety'
gmake[1]: *** [CMakeFiles/cmTC_94535.dir/build.make:66: CMakeFiles/cmTC_94535.dir/src.cxx.o] Error 1
gmake[1]: Leaving directory '/home/nb193/llvm-8.0.0/build-8.0.0/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:126: cmTC_94535/fast] Error 2

Anyone has any suggestion?

Thank you very much.

If the instructions have GCC 7 and LLVM 8, then they are obsolete and no longer appropriate.

You are still trying to build llvm, don’t you? Why? You have already installed llvm, so you don’t need to build (obsolete) llvm; just use the llvm that you already have.

The default GCC in Rocky 9 is version 11. If GCC 7 could build something, then GCC 11 can too as well as GCC 12; the gcc-toolset-12 does not help you.

The g++ is hardlink to c++ – they are the same binary, same compiler.

Where did you “change c++ to g++”? To “build” application does (usually) have steps.
On traditional GNU build:

./configure   #1
make          #2
make install  #3

Step #1 configures the build system to use the tools and libraries that the system has – “creates Makefile”
Step #2 uses the Makefile to compile and link the binaries
Step #3 copies the binaries to where they are used from

On Rocky system you want to do all these steps as regular account. Furthermore, you have to tell in Step #1 that the install location is somewhere that your account can write to on Step #3. For example ~/.local

Your application does use CMake, rather than GNU build tools. Hence:

cmake         #1
make          #2   or: cmake --build
make install  #3   or: cmake --install

If you do switch compiler, then you should clean out the original config that Step #1 did and redo Step #1 so that the use of new compiler is set up appropriately. That is, the “switch” is to make the new compiler visible so that cmake finds it.

1 Like

My instruction said:

How should I do, if I will install the latest version 15.0.7? I don’t see the cfe.
Thank you very much.

Everything in that screenshot is entirely unnecessary (and some really atrocious), because the

dnf install llvm

did already give you llvm.

Up to now you have been about llvm-8.0.0 and now suddenly you want llvm-15.0.7?
The answer is still: no.

Enterprise Linux has a set of software. The llvm is in that set. Red Hat maintains that set.
One does not replace software in the set.

One can add what is not included in the set, but only when there is a very good reason.

I did ask why you do need llvm. Your answer was not clear. What will you use the llvm for?

1 Like

I think it need for PostGIS. Does Rocky 9 still need it? Anyway, I skipped the llvm to the PostGIS. However, I found this error:

configure: error: the PGXS Makefile /usr/pgsql-15/lib/pgxs/src/makefiles/ cannot be found. Please install the PostgreSQL server development packages and re-run configure.

From this command:

./configure --with-library-minor-version --with-pgconfig=/usr/pgsql-15/bin/pg_config --with-geosconfig=/usr/local/bin/geos-config --with-xml2config=/usr/local/bin/xml2-config --with-jsondir=/home/nb193/json-c-json-c-0.13.1-20180305-build --without-raster

Do you have any suggestions?
Thank you very much.

The error message clearly states that you have not installed “PostgreSQL server development packages” when you have installed the PostgreSQL.

The Rocky 9 does not have PostgreSQL 15 and the /usr/pgsql-15 is a surprising path for packaged content.
The Rocky 9 repos do have PostgreSQL 13, so that PostgreSQL would be trivial to install.

You do know why you have something else than the PostgreSQL that Rocky 9 has.
You do know how you did install it and should know how to add the missing components.

(Rocky 9 does have libxml2 and json-c too, but even for those you have your own versions …)

1 Like

Oh, now I’m using the PostgreSQL 15 DB, how should I do?
Thank you very much.

I found how to install PostgreSQL 15 to the Rocky 9 in the official website here PostgreSQL: Linux downloads (Red Hat family).
Thank you very much.

Ok, you have a third-part Yum repository that has packages for postgresql 15.
You can ask, does any package in repos have file named XYZ?

dnf provides *makefiles/

If there is an answer and that package is for postgresql 15, then install that package.

1 Like