Hi, I checked out guix git following instructions in https://github.com/pjotrp/guix-notes/blob/master/INSTALL.org#fetch-repository-with-git and everything checked out and built fine. the gcc installed is version 10.2.0 ./pre-inst-env gcc --version gcc (GCC) 10.2.0 Copyright (C) 2020 Free Software Foundation, Inc. I tried to update a package definition (vtk) and then tried to build it ./pre-inst-env guix build -k -K vtk and the log file shows gcc 7.5 being used (log fragment) [ 28%] Building CXX object Common/DataModel/CMakeFiles/vtkCommonDataModel.dir/vtkQuadraticLinearWedge.cxx.o cd /tmp/guix-build-vtk-8.2.0.drv-0/build/Common/DataModel && /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/bin/c++ -DVTK_IN_VTK -DvtkCommonDataModel_EXPORTS -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/DataModel -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/DataModel -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/Core -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/Core -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Utilities/KWIML -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Utilities/KWIML -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Utilities/KWSys -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Utilities/KWSys -I/tmp/guix-build-vtk-8.2.0.drv-0/build/ThirdParty/utf8 -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/ThirdParty/utf8 -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/Math -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/Math -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/Misc -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/Misc -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/System -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/System -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/Transforms -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/Transforms -O3 -DNDEBUG -fPIC -fvisibility=hidden -std=c++11 -o CMakeFiles/vtkCommonDataModel.dir/vtkQuadraticLinearWedge.cxx.o -c /tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/DataModel/vtkQuadraticLinearWedge.cxx I am not sure why gcc 7.5 is being used; no where in the package definition scm file references explicitly gcc 7.5. I did not install gcc 7.5 explicitly either. (gcc 7.5 has problem compiling the package source so I want to make sure later gcc used) Thanks for any hint on this -- Andy Tai, atai@atai.org Year 2021 民國110年 自動的精神力是信仰與覺悟 自動的行為力是勞動與技能
Hi, I checked out guix git following instructions in https://github.com/pjotrp/guix-notes/blob/master/INSTALL.org#fetch-repository-with-git and everything checked out and built fine. the gcc installed is version 10.2.0 ./pre-inst-env gcc --version gcc (GCC) 10.2.0 Copyright (C) 2020 Free Software Foundation, Inc. I tried to update a package definition (vtk) and then tried to build it ./pre-inst-env guix build -k -K vtk and the log file shows gcc 7.5 being used (log fragment) [ 28%] Building CXX object Common/DataModel/CMakeFiles/vtkCommonDataModel.dir/vtkQuadraticLinearWedge.cxx.o cd /tmp/guix-build-vtk-8.2.0.drv-0/build/Common/DataModel && /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/bin/c++ -DVTK_IN_VTK -DvtkCommonDataModel_EXPORTS -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/DataModel -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/DataModel -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/Core -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/Core -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Utilities/KWIML -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Utilities/KWIML -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Utilities/KWSys -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Utilities/KWSys -I/tmp/guix-build-vtk-8.2.0.drv-0/build/ThirdParty/utf8 -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/ThirdParty/utf8 -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/Math -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/Math -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/Misc -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/Misc -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/System -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/System -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/Transforms -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/Transforms -O3 -DNDEBUG -fPIC -fvisibility=hidden -std=c++11 -o CMakeFiles/vtkCommonDataModel.dir/vtkQuadraticLinearWedge.cxx.o -c /tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/DataModel/vtkQuadraticLinearWedge.cxx I am not sure why gcc 7.5 is being used; no where in the package definition scm file references explicitly gcc 7.5. I did not install gcc 7.5 explicitly either. (gcc 7.5 has problem compiling the package source so I want to make sure later gcc used) Thanks for any hint on this
Hi, I checked out guix git following instructions in https://github.com/pjotrp/guix-notes/blob/master/INSTALL.org#fetch-repository-with-git and everything checked out and built fine. the gcc installed is version 10.2.0 ./pre-inst-env gcc --version gcc (GCC) 10.2.0 Copyright (C) 2020 Free Software Foundation, Inc. I tried to update a package definition (vtk) and then tried to build it ./pre-inst-env guix build -k -K vtk and the log file shows gcc 7.5 being used (log fragment) [ 28%] Building CXX object Common/DataModel/CMakeFiles/vtkCommonDataModel.dir/vtkQuadraticLinearWedge.cxx.o cd /tmp/guix-build-vtk-8.2.0.drv-0/build/Common/DataModel && /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/bin/c++ -DVTK_IN_VTK -DvtkCommonDataModel_EXPORTS -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/DataModel -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/DataModel -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/Core -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/Core -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Utilities/KWIML -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Utilities/KWIML -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Utilities/KWSys -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Utilities/KWSys -I/tmp/guix-build-vtk-8.2.0.drv-0/build/ThirdParty/utf8 -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/ThirdParty/utf8 -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/Math -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/Math -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/Misc -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/Misc -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/System -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/System -I/tmp/guix-build-vtk-8.2.0.drv-0/build/Common/Transforms -I/tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/Transforms -O3 -DNDEBUG -fPIC -fvisibility=hidden -std=c++11 -o CMakeFiles/vtkCommonDataModel.dir/vtkQuadraticLinearWedge.cxx.o -c /tmp/guix-build-vtk-8.2.0.drv-0/VTK-8.2.0/Common/DataModel/vtkQuadraticLinearWedge.cxx I am not sure why gcc 7.5 is being used; no where in the package definition scm file references explicitly gcc 7.5. I did not install gcc 7.5 explicitly either. (gcc 7.5 has problem compiling the package source so I want to make sure later gcc used) Thanks for any hint on this
On Mon, Feb 22, 2021 at 04:10:16PM -0800, Andy Tai wrote: [...] > I am not sure why gcc 7.5 is being used; no where in the package > definition scm file references explicitly gcc 7.5. I did not install > gcc 7.5 explicitly either. This is the "default" GCC package used when building packages, gcc-final from %final-inputs in 'gnu/packages/commencement.scm': https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/commencement.scm?h=v1.2.0#n3753 If you follow the chain of inheritance and references from gcc-final, you'll see it goes like this: gcc-final -> gcc-boot0 -> gcc -> gcc-7.5 ... and in gcc-7.5, the version is defined. You can override it by adding other packages of gcc to the native-inputs of vtk. For example: ------ diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm index c3ea8491d9..195b21c508 100644 --- a/gnu/packages/image-processing.scm +++ b/gnu/packages/image-processing.scm @@ -49,6 +49,7 @@ #:use-module (gnu packages documentation) #:use-module (gnu packages flex) #:use-module (gnu packages fontutils) + #:use-module (gnu packages gcc) #:use-module (gnu packages geo) #:use-module (gnu packages ghostscript) #:use-module (gnu packages gl) @@ -291,6 +292,8 @@ many popular formats.") "-DVTK_USE_SYSTEM_TIFF:BOOL=TRUE" "-DVTK_USE_SYSTEM_ZLIB:BOOL=TRUE") #:tests? #f)) ;XXX: test data not included + (native-inputs + `(("gcc" ,gcc-8))) (inputs `(("double-conversion" ,double-conversion) ("eigen" ,eigen) ------ ... and then it will be compiled using our package of GCC 8, which is precisely: ------ $ guix show gcc-toolchain@8 name: gcc-toolchain version: 8.4.0 outputs: out debug static systems: x86_64-linux i686-linux dependencies: binutils@2.34 gcc@8.4.0 glibc@2.31 ld-wrapper@0 location: gnu/packages/commencement.scm:3836:4 homepage: https://gcc.gnu.org/ license: GPL 3+ synopsis: Complete GCC tool chain for C/C++ development description: This package provides a complete GCC tool chain for C/C++ development to be installed in user profiles. This includes GCC, as well as libc (headers and binaries, plus debugging + symbols in the `debug' output), and Binutils. GCC is the GNU Compiler Collection. ------ I hope that helps!
Hi Andy, On Mon, 22 Feb 2021 at 16:10, Andy Tai <atai@atai.org> wrote: > ./pre-inst-env gcc --version > gcc (GCC) 10.2.0 > Copyright (C) 2020 Free Software Foundation, Inc. Well, this GCC 10.2 is not used by the build-system… > I tried to update a package definition (vtk) and then tried to build it > > ./pre-inst-env guix build -k -K vtk …which instead uses 7.5. > I am not sure why gcc 7.5 is being used; no where in the package > definition scm file references explicitly gcc 7.5. I did not install > gcc 7.5 explicitly either. For example, --8<---------------cut here---------------start------------->8--- $ guix environment vtk -C [env]$ gcc --version gcc (GCC) 7.5.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --8<---------------cut here---------------end--------------->8--- Quickly said, the GCC comes from the cmake-build-system. > (gcc 7.5 has problem compiling the package source so I want to make > sure later gcc used) It depends on what you want at the end: a variant for personal use or for submitting. For personal use, you can try: guix build -L /path/to/variant vtk --with-c-toolchain=gcc-toolchain@10 well, use package transformations, at CLI level or package level [1]. For submitting, I do not know what is the best. Hope that helps, simon 1: https://guix.gnu.org/manual/devel/en/guix.html#Defining-Package-Variants
Thanks. I figured out the problem, gcc version was not the problem
But gcc 10 did help by giving useful messages to point out the issue.
Thanks!
On Tue, Feb 23, 2021 at 8:12 PM zimoun <zimon.toutoune@gmail.com> wrote:
>
> Hi Andy,
>
> On Mon, 22 Feb 2021 at 16:10, Andy Tai <atai@atai.org> wrote:
>
> > ./pre-inst-env gcc --version
> > gcc (GCC) 10.2.0
> > Copyright (C) 2020 Free Software Foundation, Inc.
>
> Well, this GCC 10.2 is not used by the build-system…
>
> > I tried to update a package definition (vtk) and then tried to build it
> >
> > ./pre-inst-env guix build -k -K vtk
>
> …which instead uses 7.5.
>
>
> > I am not sure why gcc 7.5 is being used; no where in the package
> > definition scm file references explicitly gcc 7.5. I did not install
> > gcc 7.5 explicitly either.
>
> For example,
>
> --8<---------------cut here---------------start------------->8---
> $ guix environment vtk -C
> [env]$ gcc --version
> gcc (GCC) 7.5.0
> Copyright (C) 2017 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> --8<---------------cut here---------------end--------------->8---
>
> Quickly said, the GCC comes from the cmake-build-system.
>
> > (gcc 7.5 has problem compiling the package source so I want to make
> > sure later gcc used)
>
> It depends on what you want at the end: a variant for personal use or
> for submitting.
>
> For personal use, you can try:
>
> guix build -L /path/to/variant vtk --with-c-toolchain=gcc-toolchain@10
>
> well, use package transformations, at CLI level or package level [1].
>
> For submitting, I do not know what is the best.
>
>
> Hope that helps,
> simon
>
> 1: https://guix.gnu.org/manual/devel/en/guix.html#Defining-Package-Variants
--
Andy Tai, atai@atai.org, Skype: licheng.tai, Line: andy_tai, WeChat: andytai1010
Year 2021 民國110年
自動的精神力是信仰與覺悟
自動的行為力是勞動與技能
[-- Attachment #1: Type: text/plain, Size: 1447 bytes --] Hi Andy, Andy Tai <lichengtai@gmail.com> writes: > I tried to update a package definition (vtk) and then tried to build it > > ./pre-inst-env guix build -k -K vtk > > and the log file shows gcc 7.5 being used The vtk package uses the cmake-build-system, which like every build system adds some inputs to the build implicitly. One of those "implicit inputs" is gcc-final, defined in gnu/packages/commencement.scm, and it happens to be GCC 7.5: scheme@(guix-user)> (@@ (gnu packages commencement) gcc-final) $1 = #<package gcc@7.5.0 gnu/packages/commencement.scm:3561 7fe14101d780> scheme@(guix-user)> To see how the cmake-build-system adds gcc-final as an implicit input, you can start by looking at guix/build-system/cmake.scm. In short, the "lower" procedure returns a bag, and it adds the inputs produced by the standard-packages procedure to the returned bag. The standard-packages procedure is defined in guix/build-system/gnu.scm (the cmake-build-system re-uses many parts of the gnu-build-system), and it returns %final-inputs, which is defined in gnu/packages/commencement. It is here that the "gcc" input is bound to gcc-final. I don't know why gcc-final is still GCC 7.5 rather than a more recent version, but I suspect it is related to the fact that upgrading gcc-final would cause virtually every package to be rebuilt. For that reason, we probably don't upgrade it often. -- Chris [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 832 bytes --]