Compiler error reporting is too harsh for configure perhaps remove werror

I'm trying to compile zlib from the command line, and I'm getting this message when using -Wall -Wextra -Wconversion (full cross-compile script is below): Compiler error reporting is too harsh f...

I’m trying to compile zlib from the command line, and I’m getting this message when using -Wall -Wextra -Wconversion (full cross-compile script is below):

Compiler error reporting is too harsh for ./configure (perhaps remove
-Werror).

Here’s the configure test that’s generating the line:

cat > $test.c << EOF
int foo() { return 0; }
EOF
echo "Checking for obsessive-compulsive compiler options..." >> configure.log
if try $CC -c $CFLAGS $test.c; then
  :
else
  echo "Compiler error reporting is too harsh for $0 (perhaps remove -Werror)." | tee -a configure.log
  leave 1
fi

Its not clear to me what exactly is being judged too harsh (especially since -Werror is not present). I also don’t quite understand what the sample program used in the test is doing, so its not clear to me what the criteria is for judging the compiler warnings «too harsh».

What is zlib complaining is too harsh?


#! /bin/sh

export PATH="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH"

export CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
export CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
export LD=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
export AR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
export RANLIB=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib

export CFLAGS="-Wall -Wextra -Wconversion --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdks""
export CXXFLAGS="-Wall -Wextra -Wconversion --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk""

@kelbstf

Hello,

i almost completed cross compiling

eb --debug foss-2020a.eb --optarch=x86-rome --robot

but the dependency zlib fails like this:

== processing EasyBuild easyconfig /opt/ohpc/admin/easybuild/eb20211109/easybuild/easyconfigs/z/zlib/zlib-1.2.11-GCCcore-9.3.0.eb
== building and installing Compiler/GCCcore/9.3.0/lib/zlib/1.2.11...

== FAILED: Installation ended unsuccessfully (build directory: 
/opt/ohpc/admin/easybuild/eb20211109/easybuild/build/zlib/1.2.11/GCCcore-9.3.0): build failed (first 300 chars): 
cmd " ./configure --prefix=/opt/ohpc/pub/appseb/znver2/zlib/1.2.11-GCCcore-9.3.0 " exited with exit code 1 and output:
Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).
** ./configure aborting.
 (took 0 secs)
== Results of the build can be found in the log file(s) /tmp/eb-26mi0y5n/easybuild-zlib-1.2.11-20211125.212137.domWo.log
ERROR: Build of /opt/ohpc/admin/easybuild/eb20211109/easybuild/easyconfigs/z/zlib/zlib-1.2.11-GCCcore-9.3.0.eb failed (err: 'build failed (first 300 chars): cmd " ./configure --prefix=/opt/ohpc/pub/appseb/znver2/zlib/1.2.11-GCCcore-9.3.0 " exited with exit code 1 and output:nCompiler error reporting is too harsh for ./configure (perhaps remove -Werror).n** ./configure aborting.n')

From «/tmp/eb-26mi0y5n/easybuild-zlib-1.2.11-20211125.212137.domWo.log»:

== 2021-11-25 21:21:38,392 easyblock.py:3915 
WARNING build failed (first 300 chars): 
cmd " ./configure --prefix=/opt/ohpc/pub/appseb/znver2/zlib/1.2.11-GCCcore-9.3.0 "
exited with exit code 1 and output:
Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).
** ./configure aborting.

Is it possible that this is due to the cross compiling situation?
I am using the haswell based OS-level «9.3.0 (GCC)» for this compilation…

Would really appreciate any hint how to tackle such an ERROR with components of a toolchain.

@boegel

Hmm, never seen this error before…

Can you provide some more information about the system on which you’re seeing this?
Can you share the output of eb --show-system-info?

@ocaisa

@kelbstf

Hello @boegel & @ocaisa,

thank you for your help.
I also found this to be a surprisingly rare error message. Seem like i hit a genuine border case. Should start collecting those ;-)

The situation:

  • Heterogeneous cluster, with master on haswell and computes on EPYC2
  • EasyBuild executed on master, in venv
  • EasyBuild is planned to take care of ideally the entire research application software stack, therefore i start with the toolchain
  • My «bootsstrap» compiler is the OS level GCC, loaded as a module at compile time for the toolchain
  • System is CentOS8 and OHPC 2.3

System specs:

bash-4.4$ eb --show-system-info
System information (master):

* OS:
  -> name: centos linux
  -> type: Linux
  -> version: 8.4.2105
  -> platform name: x86_64-unknown-linux

* CPU:
  -> vendor: Intel
  -> architecture: x86_64
  -> family: Intel
  -> arch name: UNKNOWN (archspec is not installed?)
  -> model: Intel Core Processor (Haswell, no TSX)
  -> speed: 2599.996
  -> cores: 8
  -> features: abm,aes,apic,arat,avx,avx2,bmi1,bmi2,clflush,cmov,constant_tsc,cpuid,cpuid_fault,cx16,cx8,de,erms,f16c,fma,fpu,fsgsbase,fxsr,hypervisor,ibpb,ibrs,invpcid,invpcid_single,lahf_lm,lm,mca,mce,md_clear,mmx,movbe,msr,mtrr,nopl,nx,pae,pat,pcid,pclmulqdq,pge,pni,popcnt,pse,pse36,pti,rdrand,rdtscp,rep_good,sep,smep,ssbd,sse,sse2,sse4_1,sse4_2,ssse3,syscall,tsc,tsc_deadline_timer,tsc_known_freq,vme,x2apic,xsave,xsaveopt,xtopology

* software:
  -> glibc version: 2.28
  -> Python binary: /opt/ohpc/admin/easybuild/bin/python3
  -> Python version: 3.6.8

GCC:

bash-4.4$ which gcc
/opt/ohpc/pub/compiler/gcc/9.3.0/bin/gcc

-bash-4.4$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/ohpc/pub/compiler/gcc/9.3.0/libexec/gcc/x86_64-pc-linux-gnu/9.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --disable-multilib --enable-languages=c,c++,fortran --prefix=/opt/ohpc/pub/compiler/gcc/9.3.0 --disable-static --enable-shared
Thread model: posix
gcc version 9.3.0 (GCC)

@ocaisa: i also considered this option, but then believed it would not match this situation, since all the other components of the toolchain seemed to have done fine, it seems just to hit zlib.
Perhaps zlib applies a different configuration?

My next stop would be «eb —debug foss-2020a.eb —optarch=haswell —robot», which i need anyways…

@ocaisa

Where did you find x86-rome as a value for opt-arch? I think that’s only for Cray compilers…are you on a Cray system? I think that should be znver2 for GCC (but I had to do quite a bit of googling to find that).

Either way you are going to run into a LOT of issues if you try to cross-compile everything, since any sanity check commands will likely not execute correctly. You could compile some things generically on the login (for example GCCcore and anything at that level) so that they will work on both the login and compute, but once you get to performance critical software you will save yourself a lot of pain if you build on the compute nodes with default settings.

@ocaisa

To do a generic compilation for anything at GCCcore you can use

--optarch="GCCcore:march=haswell -mtune=haswell"

in your EB settings. With this setting you can build everything on the compute nodes, and anything at GCCcore will still run on the login nodes.

@kelbstf

Oh that’s interesting. I also was unsure about the proper parameter name for specifying target architectures.
I ended up with assuming that «znver2» would be what gcc itself is using,
while EasyBuild might use «x86-rome»,
based from what i found here «https://easybuilders.github.io/easybuild-tutorial/2021-lust/cray/custom_toolchains/» —
which, as you said, is actually meant for Cray,
but i simply gave it a shot.

So far i shied away from using the compute nodes for compilation (which is abolutely preferred on the long),
as i wanted to postpone the EASYBUILD Slurm integration to a better timewindow
due to time pressure.
But reading your recommendation, i’ll definitely think twice.

If both aspects of the above might not contribute to/cause this zlib problem,
i just wanted to add the error log from my «eb —debug foss-2020a.eb —optarch=haswell —robot»,
which had the same issue with zlib:

/tmp/eb-cwfhxult/easybuild-zlib-1.2.11-20211126.115625.Djumm.log:

== 2021-11-26 11:56:26,069 modules.py:608 DEBUG Result for existence check of GCCcore/9.3.0 based on 'module show' output line '   /opt/ohpc/pub/moduleseb/znver2/all/Core/compiler/GCCcore/9.3.0.lua:': True
== 2021-11-26 11:56:26,069 modules.py:654 INFO Result for existence check of GCCcore/9.3.0 module: True

== 2021-11-26 11:56:26,070 toolchain.py:760 INFO List of toolchain dependency modules and toolchain definition match!
== 2021-11-26 11:56:26,071 compiler.py:361 INFO _set_optimal_architecture: using haswell as optarch for x86_64.

== 2021-11-26 11:56:26,073 toolchain.py:426 DEBUG get_software_root software root /opt/ohpc/pub/appseb/znver2/binutils/2.34 for binutils was found in environment
== 2021-11-26 11:56:26,074 environment.py:91 INFO Environment variable CC set to gcc (previously undefined)
== 2021-11-26 11:56:26,075 environment.py:91 INFO Environment variable EBVARCC set to gcc (previously undefined)

== 2021-11-26 11:56:26,075 toolchain.py:1117 DEBUG _setenv_variables: setting environment variable CXX to g++
== 2021-11-26 11:56:26,075 environment.py:91 INFO Environment variable CXX set to g++ (previously undefined)
== 2021-11-26 11:56:26,075 environment.py:91 INFO Environment variable EBVARCXX set to g++ (previously undefined)

== 2021-11-26 11:56:26,078 easyblock.py:1885 DEBUG Changed to real build directory /opt/ohpc/admin/easybuild/easybuild/build/zlib/1.2.11/GCCcore-9.3.0/zlib-1.2.11/ (start_dir)

== 2021-11-26 11:56:26,078 easyblock.py:3598 INFO Starting configure step
== 2021-11-26 11:56:26,079 easyconfig.py:1686 INFO Generating template values...
== 2021-11-26 11:56:26,079 templates.py:189 DEBUG config: zlib EasyConfig @ /opt/ohpc/admin/easybuild/easybuild/easyconfigs/z/zlib/zlib-1.2.11-GCCcore-9.3.0.eb
== 2021-11-26 11:56:26,079 templates.py:216 DEBUG version found in easyconfig is 1.2.11
== 2021-11-26 11:56:26,079 templates.py:318 DEBUG name: bitbucket_account, config: %(namelower)s
== 2021-11-26 11:56:26,079 templates.py:318 DEBUG name: github_account, config: %(namelower)s
== 2021-11-26 11:56:26,079 templates.py:318 DEBUG name: name, config: zlib
== 2021-11-26 11:56:26,079 templates.py:318 DEBUG name: parallel, config: 8
== 2021-11-26 11:56:26,079 templates.py:318 DEBUG name: version, config: 1.2.11
== 2021-11-26 11:56:26,079 templates.py:318 DEBUG name: versionsuffix, config: 
== 2021-11-26 11:56:26,079 templates.py:318 DEBUG name: versionprefix, config: 
== 2021-11-26 11:56:26,080 easyconfig.py:1705 INFO Template values: arch='x86_64', bitbucket_account='zlib', builddir='/opt/ohpc/admin/easybuild/easybuild/build/zlib/1.2.11/GCCcore-9.3.0', github_account='zlib', installdir='/opt/ohpc/pub/appseb/znver2/zlib/1.2.11-GCCcore-9.3.0', module_name='zlib/1.2.11', name='zlib', nameletter='z', nameletterlower='z', namelower='zlib', parallel='8', toolchain_name='GCCcore', toolchain_version='9.3.0', version='1.2.11', version_major='1', version_major_minor='1.2', version_minor='2', versionprefix='', versionsuffix=''
== 2021-11-26 11:56:26,080 easyblock.py:3606 INFO Running method configure_step part of step configure
== 2021-11-26 11:56:26,080 run.py:214 DEBUG run_cmd: running cmd  ./configure --prefix=/opt/ohpc/pub/appseb/znver2/zlib/1.2.11-GCCcore-9.3.0  (in /opt/ohpc/admin/easybuild/easybuild/build/zlib/1.2.11/GCCcore-9.3.0/zlib-1.2.11)
== 2021-11-26 11:56:26,080 run.py:233 INFO running cmd:  ./configure --prefix=/opt/ohpc/pub/appseb/znver2/zlib/1.2.11-GCCcore-9.3.0  
== 2021-11-26 11:56:26,162 build_log.py:169 ERROR EasyBuild crashed with an error (at easybuild/lib/python3.6/site-packages/easybuild/base/exceptions.py:124 in __init__): cmd " ./configure --prefix=/opt/ohpc/pub/appseb/znver2/zlib/1.2.11-GCCcore-9.3.0 " exited with exit code 1 and output:
Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).
** ./configure aborting.
 (at easybuild/lib/python3.6/site-packages/easybuild/tools/run.py:618 in parse_cmd_output)
== 2021-11-26 11:56:26,163 build_log.py:265 INFO ... (took < 1 sec)
== 2021-11-26 11:56:26,163 filetools.py:1971 INFO Removing lock /opt/ohpc/admin/easybuild/easybuild/locks/_opt_ohpc_pub_appseb_znver2_zlib_1.2.11-GCCcore-9.3.0.lock...
== 2021-11-26 11:56:26,164 filetools.py:380 INFO Path /opt/ohpc/admin/easybuild/easybuild/locks/_opt_ohpc_pub_appseb_znver2_zlib_1.2.11-GCCcore-9.3.0.lock successfully removed.
== 2021-11-26 11:56:26,164 filetools.py:1975 INFO Lock removed: /opt/ohpc/admin/easybuild/easybuild/locks/_opt_ohpc_pub_appseb_znver2_zlib_1.2.11-GCCcore-9.3.0.lock
== 2021-11-26 11:56:26,164 easyblock.py:3915 WARNING build failed (first 300 chars): cmd " ./configure --prefix=/opt/ohpc/pub/appseb/znver2/zlib/1.2.11-GCCcore-9.3.0 " exited with exit code 1 and output:
Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).
** ./configure aborting.

== 2021-11-26 11:56:26,164 easyblock.py:307 INFO Closing log for application name zlib version 1.2.11
(eb20211109) -bash-4.4$ 

It seems to indicate that zlib finds all the prerequisites…
I’ll try the generic compilation for comparison next.
Thank you again!

@ocaisa

The newer EB slurm integration is actually pretty trivial (--job-backend=Slurm) since it doesn’t require any configuration. Well, that’s not entirely true it of course depends on your Slurm setup (and the existence of sensible defaults). You can influence the job submission with relevant Slurm environment variables (see https://slurm.schedmd.com/sbatch.html#SECTION_INPUT-ENVIRONMENT-VARIABLES).

@kelbstf

That’s great to hear, thank you for your encouragement.
In this specific deployment so far computes don’t have write access to the softwaretree.
And EasyBuild is designed in this deploymnt to be used for administratively maintaining a reference grade softwarestack, and therefore lives in a different access controlled path, which is not shared among the computes.
That would have to be reworked, which i hoped to do when the 90%-user-requirements are satisfied and user really need EasyBuild ;-) But maybe this has simply to be adjusted now.

@kelbstf

Hello, i just wanted to feed back that i have rebuilt the deployment concept for easybuild from scratch, allowing now compilations be executed on the compute nodes of the respective architecture, just to make sure.
Fundamentally this is now a clean installation of EB 4.5.0, but interestingly enough i still run into the exact same issue with compiling zlib as described above.

easyblock.py:3915 WARNING build failed (first 300 chars): cmd " ·
./configure --prefix=/opt/pm/pub/app/haswell/zlib/1.2.11-GCCcore-9.3.0 " 
exited with exit code 1 and output:
Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).
** ./configure aborting.

I would fall back to compiling zlib generically, but it would feel better to have found the reason… Just in case it might indicate a fundamental issue i can’t workaround later on in the same manner…

Does anyone have a recommendation how to obtain deeper debugging information beyond of what «—debug» already provides?
Maybe that would get me closer.
Or is it possibly better to start the software tree just with installing the singular compiler, and using that for building the toolchain, instead of using the OS level GCC as «bootstrap» compiler?

Any input is highly welcome.
Best

@kelbstf

Hello, i found that it seems to have issues to find a module, which actually is available, and maybe that causes a compiler detection issue:

eb --debug foss-2020a.eb --optarch=haswell --robot --extended-dry-run
== Temporary log file in case of crash /tmp/eb-tw01e941/easybuild-dez2koe9.log

[prepare_step method]
Defining build environment, based on toolchain (options) and specified dependencies...

Loading toolchain module...

module load M4/1.4.18 [SIMULATED]
module load binutils/2.34 [SIMULATED]
module load GCCcore/9.3.0 [SIMULATED]

Loading modules for dependencies...

module load binutils/2.34 [SIMULATED]

Full list of loaded modules:
  1) EasyBuild/20211128-haswell
  2) gnu9/9.3.0

Defining build environment...

[ ... ]

configuring... [DRY RUN]

[configure_step method]
  running command "./configure --prefix=/opt/pm/pub/app/haswell/zlib/1.2.11-GCCcore-9.3.0"
  (in /opt/pm/admin/easybuild/450/easybuild/build/zlib/1.2.11/GCCcore-9.3.0/zlib-1.2.11)

building... [DRY RUN]

[build_step method]
  running command "make  -j 8"
  (in /opt/pm/admin/easybuild/450/easybuild/build/zlib/1.2.11/GCCcore-9.3.0/zlib-1.2.11)

testing... [DRY RUN]

[test_step method]

installing... [DRY RUN]

[stage_install_step method]

[make_installdir method]
directory /opt/pm/pub/app/haswell/zlib/1.2.11-GCCcore-9.3.0 removed

[install_step method]
  running command "make install"
  (in /opt/pm/admin/easybuild/450/easybuild/build/zlib/1.2.11/GCCcore-9.3.0/zlib-1.2.11)

taking care of extensions... [DRY RUN]

[extensions_step method]

restore after iterating... [DRY RUN]

[post_iter_step method]

postprocessing... [DRY RUN]

[post_install_step method]

sanity checking... [DRY RUN]

[sanity_check_step method]
Sanity check paths - file ['files']
  * include/zconf.h
  * include/zlib.h
  * lib/libz.a
  * lib/libz.so
Sanity check paths - (non-empty) directory ['dirs']
  (none)
Sanity check commands
  (none)

cleaning up... [DRY RUN]

[cleanup_step method]
directory /opt/pm/admin/easybuild/450/easybuild/build/zlib/1.2.11/GCCcore-9.3.0 removed

creating module... [DRY RUN]

[make_module_step method]

!!!
!!! WARNING: ignoring error "Can't get value from a non-existing module GCCcore/9.3.0"
!!!

But the module is actually available:

/opt/pm/pub/mod/haswell/all/Core/compiler/GCCcore/9.3.0.lua:
help([==[

Description
===========
The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada,
 as well as libraries for these languages (libstdc++, libgcj,...).


More information
================
 - Homepage: https://gcc.gnu.org/
]==])

whatis([==[Description: The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada,
 as well as libraries for these languages (libstdc++, libgcj,...).]==])
whatis([==[Homepage: https://gcc.gnu.org/]==])
whatis([==[URL: https://gcc.gnu.org/]==])

local root = "/opt/pm/pub/app/haswell/GCCcore/9.3.0"

conflict("GCCcore")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/base")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/astro")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/bio")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/cae")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/chem")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/compiler")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/data")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/debugger")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/devel")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/geo")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/ide")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/lang")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/lib")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/math")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/mpi")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/numlib")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/perf")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/quantum")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/phys")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/system")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/toolchain")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/tools")
prepend_path("MODULEPATH", "/opt/pm/pub/mod/haswell/all/Compiler/GCCcore/9.3.0/vis")

prepend_path("CMAKE_LIBRARY_PATH", pathJoin(root, "lib64"))
prepend_path("CMAKE_PREFIX_PATH", root)
prepend_path("LD_LIBRARY_PATH", pathJoin(root, "lib64"))
prepend_path("MANPATH", pathJoin(root, "share/man"))
prepend_path("PATH", pathJoin(root, "bin"))
prepend_path("XDG_DATA_DIRS", pathJoin(root, "share"))
setenv("EBROOTGCCCORE", root)
setenv("EBVERSIONGCCCORE", "9.3.0")
setenv("EBDEVELGCCCORE", pathJoin(root, "easybuild/Core-compiler-GCCcore-9.3.0-easybuild-devel"))

-- Built with EasyBuild version 4.5.0

But the «loaded module» for GCC is still the one belonging to the bootstrap compiler, found as «gnu9/9.3.0» .
Is this problem possibly some sort of «handover» issue when compiling a toolchain from scratch, where the bootstrap compiler has a different module name ( «gnu9/9.3.0») then the GCC of the toolchain to build (GCCcore/9.3.0)?
I am not familiar with how this alleged «handover» is meant to work behind the scenes…
Best

@kelbstf

Hmm…
I tried brute force with commenting the following section from «zlib-1.2.11», in order to silence the error message:

if try $CC -c $CFLAGS $test.c; then
  :
else
  echo "Compiler error reporting is too harsh for $0 (perhaps remove -Werror)." | tee -a configure.log
  leave 1
fi

And it made obvious what this was supposed to check:

== 2021-11-29 19:48:47,806 run.py:214 DEBUG run_cmd: running cmd  ./configure --prefix=/opt/pm/pub/app/haswell/zlib/1.2.11-GCCcore-9.3.0  (in /opt/pm/admin/easybuild/eb20211128/easybuild/build/zlib/1.2.11/GCCcore-9.3.0/zlib-1.2.11)
== 2021-11-29 19:48:47,806 run.py:233 INFO running cmd:  ./configure --prefix=/opt/pm/pub/app/haswell/zlib/1.2.11-GCCcore-9.3.0  
== 2021-11-29 19:48:47,910 build_log.py:169 ERROR EasyBuild crashed with an error (at easybuild/eb20211128/lib/python3.6/site-packages/easybuild/base/exceptions.py:124 in __init__): cmd " ./configure --prefix=/opt/pm/pub/app/haswell/zlib/1.2.11-GCCcore-9.3.0 " exited with exit code 1 and output:
Checking for shared library support...
No shared library support; try without defining CC and CFLAGS
Building static library libz.a version 1.2.11 with gcc.
Checking for size_t... No.
Checking for long long... No.
Failed to find a pointer-size integer type.
** ./configure aborting.

The currently active compiler:

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/ohpc/pub/compiler/gcc/9.3.0/libexec/gcc/x86_64-pc-linux-gnu/9.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --disable-multilib --enable-languages=c,c++,fortran --prefix=/opt/ohpc/pub/compiler/gcc/9.3.0 --disable-static --enable-shared
Thread model: posix
gcc version 9.3.0 (GCC)

Not quite sure yet what to make of it…

@kelbstf

I just removed all the previous installations, while keeping the sources, and successfully installed just GCC core via «eb —debug GCCcore-9.3.0.eb —optarch=haswell —robot».
This also successfully installed «zlib/1.2.11», from the exact same source package.
The «bootstrap» compiler used for this was the same as used above.
Therefore it looks like the failing compilation of «zlib/1.2.11» only occurs, when installing «eb —debug foss-2020a.eb —optarch=haswell —robot» from scratch.
Maybe this rings a bell for the hepcats ;-)
Best regards.

@ocaisa

I don’t think this has anything to do with EasyBuild, but was rooted in the (bad) --optarch=x86-rome flag you used, which must have tainted your GCCcore installation somehow

@kelbstf

@ocaisa: thank you for sticking around!
Actually the issue still persists, and the cross compilation situation was the first trait i excluded from my debugging effort.

The situtation as of now is:
a) eb —debug GCCcore-9.3.0.eb —optarch=haswell —robot # works, including «zlib 1.2.11»
b) eb —debug foss-2020a.eb —optarch=haswell —robot # fails, due to failing «zlib 1.2.11»

  • both executed locally on a haswell system
  • exact same source files, in particular for zlib
  • problem always: zlib 1.2.11 stumbeling over issues apparently related to «shared library support»
  • environment is stock OHPC 2.3, i.e.: OHPC’s GCC9.3.0, which is the same version as installed via EasyBuild
  • only «fancy» environmental feature: EasyBuild installed via pip in a dedicated venv
  • it is only zlib which is affected when compiling the foss-2020a.eb toolchain

It looks like the configuration for the zlib build behaves differently in the contexts of the different packages to install?
No idea if that makes sense….
Also zlib seems to trigger such types of errors upon compilation in other situations as well: https://www.bbsmax.com/A/kjdwQOeEJN/. Maybe zlib has some special compiler checks going on?

Best regards

@kelbstf

Hello,
i just tried to install «foss-2020a.eb» after having successfully installed «GCCcore/9.3.0», using «GCCcore/9.3.0».
But it seems to not detect the already installed GCCCore, and accordinlgy also not the already installed zlib, and therefore fails in the exact same manner:

eb --debug foss-2020a.eb --robot
== Temporary log file in case of crash /tmp/eb-du2h8ikk/easybuild-zotzyu1e.log
== found valid index for /opt/pm/admin/easybuild/eb20211128/easybuild/easyconfigs, so using it...
== found valid index for /opt/pm/admin/easybuild/eb20211128/easybuild/easyconfigs, so using it...
== resolving dependencies ...
== processing EasyBuild easyconfig /opt/pm/admin/easybuild/eb20211128/easybuild/easyconfigs/z/zlib/zlib-1.2.11-GCCcore-9.3.0.eb
== building and installing Compiler/GCCcore/9.3.0/lib/zlib/1.2.11...
== fetching files...
== ... (took < 1 sec)
== creating build dir, resetting environment...
== ... (took < 1 sec)
== unpacking...
== ... (took < 1 sec)
== patching...
== ... (took < 1 sec)
== preparing...
== ... (took < 1 sec)
== configuring...
== ... (took < 1 sec)
== FAILED: Installation ended unsuccessfully (build directory: /opt/pm/admin/easybuild/eb20211128/easybuild/build/zlib/1.2.11/GCCcore-9.3.0): build failed (first 300 chars): cmd " ./configure --prefix=/opt/pm/pub/app/haswell/zlib/1.2.11-GCCcore-9.3.0 " exited with exit code 1 and output:
Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).
** ./configure aborting.
 (took 0 secs)
== Results of the build can be found in the log file(s) /tmp/eb-du2h8ikk/easybuild-zlib-1.2.11-20211130.153557.AWtkg.log
ERROR: Build of /opt/pm/admin/easybuild/eb20211128/easybuild/easyconfigs/z/zlib/zlib-1.2.11-GCCcore-9.3.0.eb failed (err: 'build failed (first 300 chars): cmd " ./configure --prefix=/opt/pm/pub/app/haswell/zlib/1.2.11-GCCcore-9.3.0 " exited with exit code 1 and output:nCompiler error reporting is too harsh for ./configure (perhaps remove -Werror).n** ./configure aborting.n')

But loading the EB-installed GCC and zlib works perfectly fine:

/opt/pm/pub/mod/haswell/all/Core/lib/zlib/1.2.11.lua:

help([==[

Description
===========
zlib is designed to be a free, general-purpose, legally unencumbered -- that
 is, not covered by any patents -- lossless data-compression library for use
 on virtually any computer hardware and operating system.


More information
================
 - Homepage: https://www.zlib.net/
]==])

whatis([==[Description: 
 zlib is designed to be a free, general-purpose, legally unencumbered -- that
 is, not covered by any patents -- lossless data-compression library for use
 on virtually any computer hardware and operating system.
]==])
whatis([==[Homepage: https://www.zlib.net/]==])
whatis([==[URL: https://www.zlib.net/]==])

local root = "/opt/pm/pub/app/haswell/zlib/1.2.11"

conflict("zlib")

prepend_path("CMAKE_PREFIX_PATH", root)
prepend_path("CPATH", pathJoin(root, "include"))
prepend_path("LD_LIBRARY_PATH", pathJoin(root, "lib"))
prepend_path("LIBRARY_PATH", pathJoin(root, "lib"))
prepend_path("MANPATH", pathJoin(root, "share/man"))
prepend_path("PKG_CONFIG_PATH", pathJoin(root, "lib/pkgconfig"))
prepend_path("XDG_DATA_DIRS", pathJoin(root, "share"))
setenv("EBROOTZLIB", root)
setenv("EBVERSIONZLIB", "1.2.11")
setenv("EBDEVELZLIB", pathJoin(root, "easybuild/Core-lib-zlib-1.2.11-easybuild-devel"))

-- Built with EasyBuild version 4.5.0

EB pathes are all perfectly accessible for the EB account, that should not be a reason…
I had put my bets on EB detecting the already installed GCC and zlib when installing «foss-2020a.eb», and just adding the remaining package belonging to «foss-2020a.eb».

@kelbstf

Just realised the following:

eb --debug foss-2021a.eb --optarch=haswell --robot

== processing EasyBuild easyconfig 
/opt/pm/admin/easybuild/eb20211128/easybuild/easyconfigs/z/zlib/zlib-1.2.11.eb
== COMPLETED: Installation ended successfully</style>
(took 2 secs)

[ ... ]

== processing EasyBuild easyconfig 
/opt/pm/admin/easybuild/eb20211128/easybuild/easyconfigs/z/zlib/zlib-1.2.11-GCCcore-10.3.0.eb
== FAILED: Installation ended unsuccessfully 
(build directory: /opt/pm/admin/easybuild/eb20211128/easybuild/build/zlib/1.2.11/GCCcore-10.3.0): 
build failed 

(first 300 chars): cmd " ./configure --prefix=/opt/pm/pub/app/haswell/zlib/1.2.11-GCCcore-10.3.0 " exited with exit code 1 and output:
Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).
** ./configure aborting.

In more details:

Successful: 
/opt/pm/pub/app/haswell/zlib/1.2.11/easybuild/easybuild-zlib-1.2.11-20211130.172808.log

INFO Template values: 
builddir='/opt/pm/admin/easybuild/eb20211128/easybuild/build/zlib/1.2.11/system-system', 
installdir='/opt/pm/pub/app/haswell/zlib/1.2.11', 
module_name='zlib/1.2.11', name='zlib', nameletter='z', nameletterlower='z', namelower='zlib', parallel='8', 
toolchain_name='system', toolchain_version='system', 
version='1.2.11', version_major='1', version_major_minor='1.2', version_minor='2', versionprefix='', versionsuffix=''

INFO Running method configure_step part of step configure
running cmd  ./configure --prefix=/opt/pm/pub/app/haswell/zlib/1.2.11  
(in /opt/pm/admin/easybuild/eb20211128/easybuild/build/zlib/1.2.11/system-system/zlib-1.2.11)

INFO running cmd:  ./configure --prefix=/opt/pm/pub/app/haswell/zlib/1.2.11  

run.py:623 INFO 
cmd " ./configure --prefix=/opt/pm/pub/app/haswell/zlib/1.2.11 " exited with exit code 0 and output:

Configured with: ../configure --disable-multilib --enable-languages=c,c++,fortran --prefix=/opt/ohpc/pub/compiler/gcc/9.3.0 --disable-static --enable-shared
gcc version 9.3.0 (GCC) 
Failing: 
/tmp/eb-nj_ja5rh/easybuild-zlib-1.2.11-20211130.182305.wWRsd.log

INFO Template values: 
builddir='/opt/pm/admin/easybuild/eb20211128/easybuild/build/zlib/1.2.11/GCCcore-10.3.0', 
installdir='/opt/pm/pub/app/haswell/zlib/1.2.11-GCCcore-10.3.0', 
module_name='zlib/1.2.11', name='zlib', nameletter='z', nameletterlower='z', namelower='zlib', parallel='8', 
toolchain_name='GCCcore', toolchain_version='10.3.0', 
version='1.2.11', version_major='1', version_major_minor='1.2', version_minor='2', versionprefix='', versionsuffix=''

INFO Running method configure_step part of step configure
running cmd  ./configure --prefix=/opt/pm/pub/app/haswell/zlib/1.2.11-GCCcore-10.3.0  
(in /opt/pm/admin/easybuild/eb20211128/easybuild/build/zlib/1.2.11/GCCcore-10.3.0/zlib-1.2.11)

INFO running cmd:  ./configure --prefix=/opt/pm/pub/app/haswell/zlib/1.2.11-GCCcore-10.3.0  

build_log.py:169 ERROR 
EasyBuild crashed with an error 
(at easybuild/eb20211128/lib/python3.6/site-packages/easybuild/base/exceptions.py:124 in __init__): 
cmd " ./configure --prefix=/opt/pm/pub/app/haswell/zlib/1.2.11-GCCcore-10.3.0 " exited with exit code 1 and output:
Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).

If i understand this right: the compilation of the same zlib from the same source code

  • succeeds using the GCC of the «system»-toolchain
  • fails using the GCC of the «foss-2021a.eb»-toolchain i try to install?

Unfortunately there seems to be no info WHY the configuration fails in the second case…
I.o.w.: i have no information which prefix has been used in the configuration step…

@akesandgren

«eb —debug foss-2021a.eb —optarch=haswell —robot» is wrong, the argument to optarch is a compiler option without the leading «-«, i.e. —optarch=march=haswell, or —optarch=»GCC:march=haswell», don’t remember if the first one works also since you’re specifically building GCC/foss

@ocaisa

If you want to compile everything for GCCcore for haswell use:

--optarch="GCCcore:march=haswell -mtune=haswell"

In general just remember that these options are passed through to the underlying compiler, so that compiler needs to be able to understand them. If you look in the config.log files inside the build directories of your failing builds you will probably see that GCC is barfing because it doesn’t understand the flag you are giving it (this doesn’t affect the system compiler since these flags are not used for the system compiler). The setting I give above is specifically for GCCcore, if you want it for everything you would remove the GCCcore: specification.

@ocaisa

@kelbstf

Thank you very much to all of you,
that was sooo helpful!

All issues vanished using the correct syntax you pointed out.

I (re)read the official documentation on this topic that you referenced, and now i also understand the specific syntax of «—optarch».
The gist as i understand it is:

  1. the flags to use for indicating the architecture are the ones of the target compiler, as easybuild passes those strings through to the compiler
  2. the recommended approach to optimisation is to leave it to easybuild, and therefore executing the compilation on the target microarchitecture. «—optarch» actually should preferrably be used to disable easybuild’s automatic optimisation for obtaining generic builts.

«2.» is now implemented over here for executing EasyBuild installations via SLURM on the target compute nodes.

Best regards

@kelbstf

Many thanks again! Issue is solved from my perspective.

Тема кросс-компиляции несомненно важная. В процессе работы над различными проектами, вполне возможно, что появится необходимость в компиляции программы под различные архитектуры без прямого доступа к устройствам на нужной архитектуре. Самый обычный пример — скомпилировать файловый менеджер для машинки Raspberry Pi, но делать это непосредственно на «пироге» затея, предполагающая потратить кучу времени на ожидание (не учитывая различные проблемы и ошибки, которые, уж поверьте, будут).

Поэтому я посвящу пару записей на данную тему, поскольку подобные задачи недавно возникали у меня, с которыми мне все-таки удалось справится. И мне бы хотелось поделится полученным опытом с общественностью.

Собственно, какая задача, какие исходные данные, какие средства. Задача — скомпилировать  известный файловый менеджер Midnight Commander (mc) под систему с архитектурой ARM. В наших руках компьютер с процессором Intel, с операционной системой Ubuntu 14.04. В качестве компилятора будем использовать пакет gcc-4.7-arm-linux-gnueabi, который отлично пребывает на репозиториях. Исходный материал — исходные коды необходимых библиотек и код самого mc.

Сперва начнем с простого — установка инструментов для кросс-компиляции. Происходит все это очень просто:

# apt-get install gcc-4.7-arm-linux-gnueabi
# apt-get install gcc-arm-linux-gnueabi
Это дело работает как gcc, вызывать компилятор можно так: arm-linux-gnueabi-gcc. Все возможности смотрите тут: man arm-linux-gnueabi-gcc.

Шаг 2 — загружаем исходники. На потребуются следующие исходники:

  • mc-4.8.14
  • check-0.10.0
  • libffi-3.2.1
  • zlib-1.2.8
  • glib-2.44.1
  • ncurses-5.9

Это минимальный список исходников, которые позволят успешно использовать mc. Я забочусь о читателях, поэтому архивчик со всеми необходимыми исходниками можно загрузить ниже (если ссылка битая, или еще чего нибудь приключилось, то придется искать самостоятельно).

Шаг 3 — подготовка к кросс-компиляции. Сейчас нам необходимо подготовить скаченные исходники к компиляции. Но сначала один нюанс — мне так и не удалось скомпилировать mc с относительными путями. Кто не в курсе, проблема вот в чем — при компиляции определенных библиотек, им необходимо указывать пути до уже скомпилированных зависимых библиотек. Собственно, при компиляции самого mc нужно скармливать ему вышеприведенные либы. Указав полные пути (а конфигурационные скрипты почему то требуют указывать именно абсолютные пути), ваш mc запустится только по таким путям файловой системы, в которых все было скомпилированно. Например, если вы решили все собрать тут: /home/username/arm_mc, то ваша программа на другом компьютере запустится лишь только в  /home/username/arm_mc, при условии что все зависимые библиотеки также находятся в тех местах, на которые указывалось при кросс-компиляции. Это проблема, которую я не смог решить, буду очень благодарен, если кто либо расскажет, как правильно это сделать.

Поэтому для нашего случая мы воспользуемся самым простым вариантом: все компилировать будем сюда  /tmp/mc_build/builds, и запускать все будем также по тому пути (если вы решились делать так, то не забывайте особенность каталога tmp — после перезагрузки системы, данный каталог чистится).

Поэтому делаем следующее:

$ mkdir /tmp/mc_build

$ mkdir /tmp/mc_build/builds

$ mkdir /tmp/mc_build/sources

В каталог /tmp/mc_build/sources кладем наш архив mc_src.tar.gz и выполняем разархивацию в данный каталог содержимого всех архивов руками, либо так (перед выполнением сначала перейдите в каталог с архивом):

$ tar -xf mc_src.tar.gz && for f in *.tar*; do tar xf $f; done

Шаг 4 — компиляция. Процесс компиляции на самом деле очень прост, за нас, по сути, разработчики уже позаботились, создали скрипты конфигурации и make-файлы, которые всю грязную работу выполняют сами. От нас лишь требуется правильно предоставить требуемые зависимости и скормить скриптам нужные флаги и параметры. Как это делать будем мы: необходимо будет создавать исполняемый bash-скрипт в корне каталога компилируемой библиотеки, прописывать в данный скрипт нужные команды и выполнять этот скрипт. Собственно, займемся данным, достаточно рутинным, процессом. Для первой библиотеки я распишу полную последовательность команд, для оставшихся я приведу лишь тексты bash-скриптов.

Компиляция check-0.10.0:

Создаем файл скрипта в корне:

$ touch /tmp/mc_build/sources/check-0.10.0/my_make

Открываем его любым текстовым редактором, например:

$ nano /tmp/mc_build/sources/check-0.10.0/my_make

Копируем в этот файл следующий текст:

#!/bin/bash

ARCH=arm

CC=armlinuxgnueabigcc ./configure

host=armlinuxgnueabi

prefix=/tmp/mc_build/builds/build_check0.10.0/

enablestatic=yes

make

sudo make install

Даем данному скрипту права на выполнение:

$ chmod 755 /tmp/mc_build/sources/check-0.10.0/my_make

И выполняем данный скрипт:

$ cd /tmp/mc_build/sources/check-0.10.0
$ ./my_make

В случае успешного завершения процесса компиляции, в каталоге /tmp/mc_build/builds/ будет лежать каталог build_check-0.10.0 — это продукт нашей компиляции. В случае если такого каталога нету, либо он пустой — произошла ошибка, необходимо читать что нам в консоли сообщает make, либо скрипт configure и пытаться исправить. Для справки, где есть полезная информация, можно выполнить следующее:

$ /tmp/mc_build/sources/check-0.10.0/configure —help

Таким же образом происходит компиляция всего остального (копируете скрипт my_make, даете ему права на исполнение, запускаете, надеетесь, чтобы не было ошибок). Поэтому далее я лишь приведу скрипты my_make для каждой библиотеки. Компилировать, кстати, библиотеки нужно в том порядке, в котором я привожу тексты скриптов.

Компиляция libffi-3.2.1:

#!/bin/bash

ARCH=arm

CC=armlinuxgnueabigcc ./configure

host=armlinuxgnueabi

prefix=/tmp/mc_build/builds/build_libffi3.2.1

enablestatic=yes

make

sudo make install

Компиляция zlib-1.2.8:
UPD: У некоторых при использовании данного скрипта для компиляции zlib появляются ошибки вроде:

«Compiler error reporting is too harsh for ./configure (perhaps remove -Werror). ** ./configure aborting.»

Логи configure.log говорят, что, почему то, arm-linux-gnueabi-gcc не понимает строку

в данном скрипте. Поэтому решение — убрать (закомментировать) эту строчку из нижеприведенного скрипта.

#!/bin/bash

ARCH=arm

CC=armlinuxgnueabigcc ./configure

static

archs=«-arch arm»

make

sudo make install DESTDIR=/tmp/mc_build/builds/build_zlib1.2.8

Компиляция ncurses-5.9:

#!/bin/bash

ARCH=arm

CC=armlinuxgnueabigcc ./configure

target=armlinuxgnueabi

withgcc=armlinuxgnueabigcc

host=armlinuxgnueabi

prefix=/tmp/mc_build/builds/build_ncurses5.9

enablestatic=yes

make

sudo make install

Компиляция glib-2.44.1:
UPD: как справедливо заметили в комментариях, в процессе сборки могут появиться ошибки о проблемах с glib-genmarshal. Предложенный вариант решения — установка пакета:
# sudo apt-get install libglib2.0-dev
Должно заработать.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

#!/bin/bash

echo «glib_cv_stack_grows=no» > armlinux.cache

echo «glib_cv_uscore=no» >> armlinux.cache

echo «ac_cv_func_posix_getpwuid_r=no» >> armlinux.cache

echo «ac_cv_func_posix_getgrgid_r=no» >> armlinux.cache

ARCH=arm

CC=armlinuxgnueabigcc ./configure

ZLIB_CFLAGS=«-I/tmp/mc_build/builds/build_zlib-1.2.8/usr/local/include/»

ZLIB_LIBS=«-L/tmp/mc_build/builds/build_zlib-1.2.8/usr/local/lib -lz»

LIBFFI_CFLAGS=«-I/tmp/mc_build/builds/build_libffi-3.2.1/lib/libffi-3.2.1/include»

LIBFFI_LIBS=«-L/tmp/mc_build/builds/build_libffi-3.2.1/lib -lffi»

host=armlinuxgnueabi

prefix=/tmp/mc_build/builds/build_glib2.44.1

enablestatic=yes

cachefile=armlinux.cache

make

sudo make install

Компиляция mc-4.8.14:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

#!/bin/bash

ARCH=arm

CC=armlinuxgnueabigcc ./configure

CHECK_CFLAGS=«-I/tmp/mc_build/builds/build_check-0.10.0/include/»

CHECK_LIBS=«-L/tmp/mc_build/builds/build_check-0.10.0/lib/ -lcheck»

GLIB_CFLAGS=«-I/tmp/mc_build/builds/build_glib-2.44.1/include/glib-2.0 -I/tmp/mc_build/builds/build_glib-2.44.1/lib/glib-2.0/include»

GLIB_LIBS=«-L/tmp/mc_build/builds/build_glib-2.44.1/lib -lglib-2.0»

GMODULE_CFLAGS=«-I/tmp/mc_build/builds/build_glib-2.44.1/include/glib-2.0 -I/tmp/mc_build/builds/build_glib-2.44.1/lib/glib-2.0/include»

GMODULE_LIBS=«-L/tmp/mc_build/builds/build_glib-2.44.1/lib/glib-2.0 -lgmodule-2.0»

host=armlinuxgnueabi

prefix=/tmp/mc_build/builds/build_mc4.8.14

enablestatic=yes

withscreen=ncurses

withncursesincludes=«/tmp/mc_build/builds/build_ncurses-5.9/include»

withncurseslibs=«/tmp/mc_build/builds/build_ncurses-5.9/lib»

make

sudo make install

В случае, если у вас после все выше проделанного появилась папочка /tmp/mc_build/builds/build_mc-4.8.14 — поздравляю, у вас, наверно, удалась кросс-компиляция файлового менеджера Midnight Commander под архитектуру ARM.

Далее действия просты — загружаем каталог /tmp/mc_build/builds на нужную систему по одноименному пути, и запускаем mc: /tmp/mc_build/builds/build_mc-4.8.14/bin/mc. Все должно работать.

build_mc

Для знатоков — в данном примере в качестве графической библиотеки использовалась библиотека ncurses, поскольку это попроще в плане сборки. Есть вариант использовать библиотеку slang (для данного примера версии 2.3.0), но это более сложная задача, поскольку slang имеет слегка больше зависимостей. Можете попробовать, у меня пока не получилось.

Всем спасибо, ставьте лайки, подписывайтесь на мой канал, всем пока!

Архив со всеми исходниками: ССЫЛКА

I’m trying to build Linux From Scratch (LFS)
I’m just following this books https://www.linuxfromscratch.org/lfs/view/stable/chapter08/eudev.html

I have this error after I run ./configure in eudev package

checking for gcc... /usr/bin/gcc
checking whether the C compiler works... no
configure: error: in `/sources/eudev-3.2.11':
configure: error: C compiler cannot create executables
See `config.log' for more details

Here is config.log
Update: (more detail)

root@lfs-host:/mnt/lfs/sources/eudev-3.2.11# cat ~/config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by eudev configure 3.2.11, which was
generated by GNU Autoconf 2.71.  Invocation command line was

  $ ./configure --prefix=/usr --bindir=/usr/sbin --sysconfdir=/etc --enable-manpages --disable-static

## --------- ##
## Platform. ##
## --------- ##

hostname = lfs-host
uname -m = x86_64
uname -r = 5.15.0-30-generic
uname -s = Linux
uname -v = #31-Ubuntu SMP Thu May 5 10:00:34 UTC 2022

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /mnt/lfs/tools/bin/
PATH: /usr/bin/


## ----------- ##
## Core tests. ##
## ----------- ##

configure:3272: looking for aux files: config.guess config.sub ltmain.sh missing install-sh compile
configure:3285:  trying ./
configure:3314:   ./config.guess found
configure:3314:   ./config.sub found
configure:3314:   ./ltmain.sh found
configure:3314:   ./missing found
configure:3296:   ./install-sh found
configure:3314:   ./compile found
configure:3496: checking for gcc
configure:3528: result: /usr/bin/gcc
configure:3881: checking for C compiler version
configure:3890: /usr/bin/gcc --version >&5
gcc (GCC) 11.2.0
Copyright (C) 2021 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.

configure:3901: $? = 0
configure:3890: /usr/bin/gcc -v >&5
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/usr LD=ld --enable-languages=c,c++ --disable-multilib --disable-bootstrap --with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (GCC)
configure:3901: $? = 0
configure:3890: /usr/bin/gcc -V >&5
gcc: error: unrecognized command-line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3901: $? = 1
configure:3890: /usr/bin/gcc -qversion >&5
gcc: error: unrecognized command-line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:3901: $? = 1
configure:3890: /usr/bin/gcc -version >&5
gcc: error: unrecognized command-line option '-version'
gcc: fatal error: no input files
compilation terminated.
configure:3901: $? = 1
configure:3921: checking whether the C compiler works
configure:3943: /usr/bin/gcc -O3 -Wall   conftest.c  >&5
/usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.0/cc1: error while loading shared libraries: /usr/lib/libz.so.1: file too short
configure:3947: $? = 1
configure:3987: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "eudev"
| #define PACKAGE_TARNAME "eudev"
| #define PACKAGE_VERSION "3.2.11"
| #define PACKAGE_STRING "eudev 3.2.11"
| #define PACKAGE_BUGREPORT "https://github.com/gentoo/eudev/issues"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
|
| int
| main (void)
| {
|
|   ;
|   return 0;
| }
configure:3992: error: in `/sources/eudev-3.2.11':
configure:3994: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_BLKID_CFLAGS_set=
ac_cv_env_BLKID_CFLAGS_value=
ac_cv_env_BLKID_LIBS_set=
ac_cv_env_BLKID_LIBS_value=
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=set
ac_cv_env_CC_value=/usr/bin/gcc
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-O3 -Wall'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_KMOD_CFLAGS_set=
ac_cv_env_KMOD_CFLAGS_value=
ac_cv_env_KMOD_LIBS_set=
ac_cv_env_KMOD_LIBS_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LT_SYS_LIBRARY_PATH_set=
ac_cv_env_LT_SYS_LIBRARY_PATH_value=
ac_cv_env_PKG_CONFIG_LIBDIR_set=
ac_cv_env_PKG_CONFIG_LIBDIR_value=
ac_cv_env_PKG_CONFIG_PATH_set=
ac_cv_env_PKG_CONFIG_PATH_value=
ac_cv_env_PKG_CONFIG_set=
ac_cv_env_PKG_CONFIG_value=
ac_cv_env_SELINUX_CFLAGS_set=
ac_cv_env_SELINUX_CFLAGS_value=
ac_cv_env_SELINUX_LIBS_set=
ac_cv_env_SELINUX_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_prog_ac_ct_CC=/usr/bin/gcc

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL=''
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR=''
AM_BACKSLASH=''
AM_DEFAULT_V=''
AM_DEFAULT_VERBOSITY=''
AM_V=''
AR=''
AUTOCONF=''
AUTOHEADER=''
AUTOMAKE=''
AWK=''
BLKID_CFLAGS=''
BLKID_LIBS=''
CC='/usr/bin/gcc'
CCDEPMODE=''
CFLAGS='-O3 -Wall'
CPP=''
CPPFLAGS=''
CSCOPE=''
CTAGS=''
CXX=''
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS=''
CYGPATH_W=''
DEFS=''
DEPDIR=''
DLLTOOL=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
ENABLE_HWDB_FALSE=''
ENABLE_HWDB_TRUE=''
ENABLE_MANPAGES_FALSE=''
ENABLE_MANPAGES_TRUE=''
ENABLE_MTD_PROBE_FALSE=''
ENABLE_MTD_PROBE_TRUE=''
ENABLE_PROGRAMS_FALSE=''
ENABLE_PROGRAMS_TRUE=''
ENABLE_RULE_GENERATOR_FALSE=''
ENABLE_RULE_GENERATOR_TRUE=''
ETAGS=''
EXEEXT=''
FGREP=''
GPERF=''
GREP=''
HAVE_BLKID_FALSE=''
HAVE_BLKID_TRUE=''
HAVE_INTROSPECTION_FALSE=''
HAVE_INTROSPECTION_TRUE=''
HAVE_KMOD_FALSE=''
HAVE_KMOD_TRUE=''
HAVE_SELINUX_FALSE=''
HAVE_SELINUX_TRUE=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
INSTALL_STRIP_PROGRAM=''
INTROSPECTION_CFLAGS=''
INTROSPECTION_COMPILER=''
INTROSPECTION_GENERATE=''
INTROSPECTION_GIRDIR=''
INTROSPECTION_LIBS=''
INTROSPECTION_MAKEFILE=''
INTROSPECTION_SCANNER=''
INTROSPECTION_TYPELIBDIR=''
KMOD_CFLAGS=''
KMOD_LIBS=''
LD=''
LDFLAGS=''
LIBM=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIPO=''
LN_S=''
LTLIBOBJS=''
LT_SYS_LIBRARY_PATH=''
M4=''
MAKEINFO=''
MANIFEST_TOOL=''
MKDIR_P=''
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OTOOL64=''
OTOOL=''
PACKAGE=''
PACKAGE_BUGREPORT='https://github.com/gentoo/eudev/issues'
PACKAGE_NAME='eudev'
PACKAGE_STRING='eudev 3.2.11'
PACKAGE_TARNAME='eudev'
PACKAGE_URL=''
PACKAGE_VERSION='3.2.11'
PATH_SEPARATOR=':'
PKG_CONFIG=''
PKG_CONFIG_LIBDIR=''
PKG_CONFIG_PATH=''
RANLIB=''
SED=''
SELINUX_CFLAGS=''
SELINUX_LIBS=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
UDEV_VERSION='243'
VERSION=''
ac_ct_AR=''
ac_ct_CC='/usr/bin/gcc'
ac_ct_CXX=''
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include=''
am__isrc=''
am__leading_dot=''
am__nodep=''
am__quote=''
am__tar=''
am__untar=''
bindir='/usr/sbin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
girdir=''
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh=''
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p=''
oldincludedir='/usr/include'
pdfdir='${docdir}'
pkgconfiglibdir=''
prefix='/usr'
program_transform_name='s,x,x,'
psdir='${docdir}'
rootlibdir=''
rootlibexecdir=''
rootprefix=''
rootrundir=''
runstatedir='${localstatedir}/run'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sharepkgconfigdir=''
sushell=''
sysconfdir='/etc'
target_alias=''
typelibsdir=''
udevconfdir=''
udevconffile=''
udevhwdbbin=''
udevhwdbdir=''
udevkeymapdir=''
udevkeymapforceredir=''
udevlibexecdir=''
udevrulesdir=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "eudev"
#define PACKAGE_TARNAME "eudev"
#define PACKAGE_VERSION "3.2.11"
#define PACKAGE_STRING "eudev 3.2.11"
#define PACKAGE_BUGREPORT "https://github.com/gentoo/eudev/issues"
#define PACKAGE_URL ""

configure: exit 77
root@lfs-host:/mnt/lfs/sources/eudev-3.2.11#

This error is applied to all ./configure, not only for eudev

But I check gcc is working fine

(lfs chroot) root:/sources/eudev-3.2.11# gcc
gcc: fatal error: no input files
compilation terminated.

Тема кросс-компиляции несомненно важная. В процессе работы над различными проектами, вполне возможно, что появится необходимость в компиляции программы под различные архитектуры без прямого доступа к устройствам на нужной архитектуре. Самый обычный пример — скомпилировать файловый менеджер для машинки Raspberry Pi, но делать это непосредственно на «пироге» затея, предполагающая потратить кучу времени на ожидание (не учитывая различные проблемы и ошибки, которые, уж поверьте, будут).

Поэтому я посвящу пару записей на данную тему, поскольку подобные задачи недавно возникали у меня, с которыми мне все-таки удалось справится. И мне бы хотелось поделится полученным опытом с общественностью.

Собственно, какая задача, какие исходные данные, какие средства. Задача — скомпилировать  известный файловый менеджер Midnight Commander (mc) под систему с архитектурой ARM. В наших руках компьютер с процессором Intel, с операционной системой Ubuntu 14.04. В качестве компилятора будем использовать пакет gcc-4.7-arm-linux-gnueabi, который отлично пребывает на репозиториях. Исходный материал — исходные коды необходимых библиотек и код самого mc.

Сперва начнем с простого — установка инструментов для кросс-компиляции. Происходит все это очень просто:

# apt-get install gcc-4.7-arm-linux-gnueabi

# apt-get install gcc-arm-linux-gnueabi

Это дело работает как gcc, вызывать компилятор можно так: arm-linux-gnueabi-gcc. Все возможности смотрите тут: man arm-linux-gnueabi-gcc.

Шаг 2 — загружаем исходники. На потребуются следующие исходники:

  • mc-4.8.14
  • check-0.10.0
  • libffi-3.2.1
  • zlib-1.2.8
  • glib-2.44.1
  • ncurses-5.9

Это минимальный список исходников, которые позволят успешно использовать mc. Я забочусь о читателях, поэтому архивчик со всеми необходимыми исходниками можно загрузить ниже (если ссылка битая, или еще чего нибудь приключилось, то придется искать самостоятельно).

Шаг 3 — подготовка к кросс-компиляции. Сейчас нам необходимо подготовить скаченные исходники к компиляции. Но сначала один нюанс — мне так и не удалось скомпилировать mc с относительными путями. Кто не в курсе, проблема вот в чем — при компиляции определенных библиотек, им необходимо указывать пути до уже скомпилированных зависимых библиотек. Собственно, при компиляции самого mc нужно скармливать ему вышеприведенные либы. Указав полные пути (а конфигурационные скрипты почему то требуют указывать именно абсолютные пути), ваш mc запустится только по таким путям файловой системы, в которых все было скомпилированно. Например, если вы решили все собрать тут: /home/username/arm_mc, то ваша программа на другом компьютере запустится лишь только в  /home/username/arm_mc, при условии что все зависимые библиотеки также находятся в тех местах, на которые указывалось при кросс-компиляции. Это проблема, которую я не смог решить, буду очень благодарен, если кто либо расскажет, как правильно это сделать.

Поэтому для нашего случая мы воспользуемся самым простым вариантом: все компилировать будем сюда  /tmp/mc_build/builds, и запускать все будем также по тому пути (если вы решились делать так, то не забывайте особенность каталога tmp — после перезагрузки системы, данный каталог чистится).

Поэтому делаем следующее:

$ mkdir /tmp/mc_build

$ mkdir /tmp/mc_build/builds

$ mkdir /tmp/mc_build/sources

В каталог /tmp/mc_build/sources кладем наш архив mc_src.tar.gz и выполняем разархивацию в данный каталог содержимого всех архивов руками, либо так (перед выполнением сначала перейдите в каталог с архивом):

$ tar -xf mc_src.tar.gz && for f in *.tar*; do tar xf $f; done

Шаг 4 — компиляция. Процесс компиляции на самом деле очень прост, за нас, по сути, разработчики уже позаботились, создали скрипты конфигурации и make-файлы, которые всю грязную работу выполняют сами. От нас лишь требуется правильно предоставить требуемые зависимости и скормить скриптам нужные флаги и параметры. Как это делать будем мы: необходимо будет создавать исполняемый bash-скрипт в корне каталога компилируемой библиотеки, прописывать в данный скрипт нужные команды и выполнять этот скрипт. Собственно, займемся данным, достаточно рутинным, процессом. Для первой библиотеки я распишу полную последовательность команд, для оставшихся я приведу лишь тексты bash-скриптов.

Компиляция check-0.10.0:

Создаем файл скрипта в коре:

$ touch /tmp/mc_build/sources/check-0.10.0/my_make

Открываем его любым текстовым редактором, например:

$ nano /tmp/mc_build/sources/check-0.10.0/my_make

Копируем в этот файл следующий текст:

#!/bin/bash

ARCH=arm

CC=arm-linux-gnueabi-gcc ./configure

—host=arm-linux-gnueabi

—prefix=/tmp/mc_build/builds/build_check-0.10.0/

—enable-static=yes

make

sudo make install

Даем данному скрипту права на выполнение:

$ chmod 755 /tmp/mc_build/sources/check-0.10.0/my_make

И выполняем данный скрипт:

$ cd /tmp/mc_build/sources/check-0.10.0

$ ./my_make

В случае успешного завершения процесса компиляции, в каталоге /tmp/mc_build/builds/ будет лежать каталог build_check-0.10.0 — это продукт нашей компиляции. В случае если такого каталога нету, либо он пустой — произошла ошибка, необходимо читать что нам в консоли сообщает make, либо скрипт configure и пытаться исправить. Для справки, где есть полезная информация, можно выполнить следующее:

$ /tmp/mc_build/sources/check-0.10.0/configure —help

Таким же образом происходит компиляция всего остального (копируете скрипт my_make, даете ему права на исполнение, запускаете, надеетесь, чтобы не было ошибок). Поэтому далее я лишь приведу скрипты my_make для каждой библиотеки. Компилировать, кстати, библиотеки нужно в том порядке, в котором я привожу тексты скриптов.

Компиляция libffi-3.2.1:

#!/bin/bash

ARCH=arm

CC=arm-linux-gnueabi-gcc ./configure

—host=arm-linux-gnueabi

—prefix=/tmp/mc_build/builds/build_libffi-3.2.1

—enable-static=yes

make

sudo make install

Компиляция zlib-1.2.8:

UPD: У некоторых при использовании данного скрипта для компиляции zlib появляются ошибки вроде:

«Compiler error reporting is too harsh for ./configure (perhaps remove -Werror). ** ./configure aborting.»

Логи configure.log говорят, что, почему то, arm-linux-gnueabi-gcc не понимает строку

—archs=»-arch arm»

в данном скрипте. Поэтому решение — убрать (закомментировать) эту строчку из нижеприведенного скрипта.

#!/bin/bash

ARCH=arm

CC=arm-linux-gnueabi-gcc ./configure

—static

—archs=»-arch arm»

make

sudo make install DESTDIR=/tmp/mc_build/builds/build_zlib-1.2.8

Компиляция ncurses-5.9:

#!/bin/bash

ARCH=arm

CC=arm-linux-gnueabi-gcc ./configure

—target=arm-linux-gnueabi

—with-gcc=arm-linux-gnueabi-gcc

—host=arm-linux-gnueabi

—prefix=/tmp/mc_build/builds/build_ncurses-5.9

—enable-static=yes

make

sudo make install

Компиляция glib-2.44.1:

UPD: как справедливо заметили в комментариях, в процессе сборки могут появиться ошибки о проблемах с glib-genmarshal. Предложенный вариант решения — установка пакета:

# sudo apt-get install libglib2.0-dev

Должно заработать.

#!/bin/bash

echo «glib_cv_stack_grows=no» > arm-linux.cache

echo «glib_cv_uscore=no» >> arm-linux.cache

echo «ac_cv_func_posix_getpwuid_r=no» >> arm-linux.cache

echo «ac_cv_func_posix_getgrgid_r=no» >> arm-linux.cache

ARCH=arm

CC=arm-linux-gnueabi-gcc ./configure

ZLIB_CFLAGS=»-I/tmp/mc_build/builds/build_zlib-1.2.8/usr/local/include/»

ZLIB_LIBS=»-L/tmp/mc_build/builds/build_zlib-1.2.8/usr/local/lib -lz»

LIBFFI_CFLAGS=»-I/tmp/mc_build/builds/build_libffi-3.2.1/lib/libffi-3.2.1/include»

LIBFFI_LIBS=»-L/tmp/mc_build/builds/build_libffi-3.2.1/lib -lffi»

—host=arm-linux-gnueabi

—prefix=/tmp/mc_build/builds/build_glib-2.44.1

—enable-static=yes

—cache-file=arm-linux.cache

make

sudo make install

Компиляция mc-4.8.14:

#!/bin/bash

ARCH=arm

CC=arm-linux-gnueabi-gcc ./configure

CHECK_CFLAGS=»-I/tmp/mc_build/builds/build_check-0.10.0/include/»

CHECK_LIBS=»-L/tmp/mc_build/builds/build_check-0.10.0/lib/ -lcheck»

GLIB_CFLAGS=»-I/tmp/mc_build/builds/build_glib-2.44.1/include/glib-2.0 -I/tmp/mc_build/builds/build_glib-2.44.1/lib/glib-2.0/include»

GLIB_LIBS=»-L/tmp/mc_build/builds/build_glib-2.44.1/lib -lglib-2.0″

GMODULE_CFLAGS=»-I/tmp/mc_build/builds/build_glib-2.44.1/include/glib-2.0 -I/tmp/mc_build/builds/build_glib-2.44.1/lib/glib-2.0/include»

GMODULE_LIBS=»-L/tmp/mc_build/builds/build_glib-2.44.1/lib/glib-2.0 -lgmodule-2.0″

—host=arm-linux-gnueabi

—prefix=/tmp/mc_build/builds/build_mc-4.8.14

—enable-static=yes

—with-screen=ncurses

—with-ncurses-includes=»/tmp/mc_build/builds/build_ncurses-5.9/include»

—with-ncurses-libs=»/tmp/mc_build/builds/build_ncurses-5.9/lib»

make

sudo make install

В случае, если у вас после все выше проделанного появилась папочка /tmp/mc_build/builds/build_mc-4.8.14 — поздравляю, у вас, наверно, удалась кросс-компиляция файлового менеджера Midnight Commander под архитектуру ARM.

Далее действия просты — загружаем каталог /tmp/mc_build/builds на нужную систему по одноименному пути, и запускаем mc: /tmp/mc_build/builds/build_mc-4.8.14/bin/mc. Все должно работать.

Для знатоков — в данном примере в качестве графической библиотеки использовалась библиотека ncurses, поскольку это попроще в плане сборки. Есть вариант использовать библиотеку slang (для данного примера версии 2.3.0), но это более сложная задача, поскольку slang имеет слегка больше зависимостей. Можете попробовать, у меня пока не получилось.

Всем спасибо, ставьте лайки, подписывайтесь на мой канал, всем пока!

Архив со всеми исходниками: ССЫЛКА

Итак, я пытаюсь скомпилировать приложение Homebrew для CFW Nintendo 3DS. Я делаю это на Linux Mint 18.2. Компилятор не может скомпилировать некоторые необходимые зависимости.

Вот код из компилятора:

#!/bin/sh
set -ex

mkdir -p build

# Install libarchive and libmpg123 for host
apt-get update
apt-get -y install libarchive-dev libmpg123-dev

# Install libarchive for 3ds
git clone https://github.com/Cruel/3ds_portlibs.git
cd 3ds_portlibs
make zlib
make install-zlib
make libarchive
make install

# Install libmpg123 for 3ds
wget -O libmpg123-dev.tar.gz  https://notabug.org/attachments/216a6d61-f167-4f65-84dc-fa98c2247fc1
tar -xaf libmpg123-dev.tar.gz -C $DEVKITPRO/portlibs/3ds

cd ../build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_EMULATOR=ON -DBUILD_TESTS=ON ..
make -j4

Вот ошибка вывода, которую я получаю:

+ mkdir -p build
+ apt-get update
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://dl.google.com/linux/chrome/deb stable Release
Hit:3 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:4 http://deb.torproject.org/torproject.org xenial InRelease
Hit:7 http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu xenial InRelease
Get:8 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:9 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:10 http://ppa.launchpad.net/jonathonf/ffmpeg-3/ubuntu xenial InRelease
Hit:6 http://screenshots.getdeb.net xenial-getdeb InRelease
Get:11 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Ign:12 http://packages.linuxmint.com sonya InRelease
Hit:13 http://packages.linuxmint.com sonya Release
Hit:15 http://archive.canonical.com/ubuntu xenial InRelease
Fetched 204 kB in 5s (38.6 kB/s)
Reading package lists...
+ apt-get -y install libarchive-dev libmpg123-dev
Reading package lists...
Building dependency tree...
Reading state information...
libmpg123-dev is already the newest version (1.22.4-1).
libarchive-dev is already the newest version (3.2.1-2~ubuntu16.04.1).
0 upgraded, 0 newly installed, 0 to remove and 100 not upgraded.
+ git clone https://github.com/Cruel/3ds_portlibs.git
Cloning into '3ds_portlibs'...
+ cd 3ds_portlibs
+ CFLAGS=-m64
+ make zlib
wget -O zlib-1.2.8.tar.gz "http://prdownloads.sourceforge.net/libpng/zlib-1.2.8.tar.gz"--2017-08-02 08:47:03--  http://prdownloads.sourceforge.net/libpng/zlib-1.2.8.tar.gz
Resolving prdownloads.sourceforge.net (prdownloads.sourceforge.net)... 216.34.181.59
Connecting to prdownloads.sourceforge.net (prdownloads.sourceforge.net)|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://downloads.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz [following]
--2017-08-02 08:47:03--  http://downloads.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz
Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.34.181.59
Connecting to downloads.sourceforge.net (downloads.sourceforge.net)|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://versaweb.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz [following]
--2017-08-02 08:47:04--  https://versaweb.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz
Resolving versaweb.dl.sourceforge.net (versaweb.dl.sourceforge.net)... 104.238.205.251
Connecting to versaweb.dl.sourceforge.net (versaweb.dl.sourceforge.net)|104.238.205.251|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 571091 (558K) [application/x-gzip]
Saving to: ‘zlib-1.2.8.tar.gz’

2017-08-02 08:47:04 (1.95 MB/s) - ‘zlib-1.2.8.tar.gz’ saved [571091/571091]

Using ar
Checking for arm-none-eabi-gcc...
Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).
** ./configure aborting.
Makefile:195: recipe for target 'zlib' failed
make: *** [zlib] Error 1

Я также заметил, что если я удаляю строки о zlib, я получаю другую ошибку:

+ export CPP3DS=/home/eddy/Documents/FreeShop/cpp3ds
+ for dev in ''''arc13''''
+ cd /home/eddy/Documents/FreeShop/arc13/freeshop
+ for dx in '"3ds_portlibs"' '"build"'
+ '[' -d 3ds_portlibs ']'
+ rm -r 3ds_portlibs
+ for dx in '"3ds_portlibs"' '"build"'
+ '[' -d build ']'
+ rm -r build
+ mkdir -p build
+ export CC=arm-none-eabi-gcc
+ CC=arm-none-eabi-gcc
+ export CXX=arm-none-eabi-g++
+ CXX=arm-none-eabi-g++
+ apt-get update
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://deb.torproject.org/torproject.org xenial InRelease
Hit:3 http://dl.google.com/linux/chrome/deb stable Release
Ign:4 http://packages.linuxmint.com sonya InRelease
Hit:5 http://packages.linuxmint.com sonya Release
Hit:6 http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu xenial InRelease
Hit:7 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:8 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:12 http://archive.canonical.com/ubuntu xenial InRelease
Hit:13 http://ppa.launchpad.net/jonathonf/ffmpeg-3/ubuntu xenial InRelease
Hit:14 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:10 http://screenshots.getdeb.net xenial-getdeb InRelease
Hit:15 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Reading package lists...
+ apt-get -y install libarchive-dev libmpg123-dev
Reading package lists...
Building dependency tree...
Reading state information...
libmpg123-dev is already the newest version (1.22.4-1).
libarchive-dev is already the newest version (3.2.1-2~ubuntu16.04.1).
0 upgraded, 0 newly installed, 0 to remove and 103 not upgraded.
+ git clone https://github.com/Cruel/3ds_portlibs.git
Cloning into '3ds_portlibs'...
+ cd 3ds_portlibs
+ make CC=DEVKITPRO
Please choose one of the following targets:
freetype (requires zlib to be installed)
libexif
libjpeg-turbo
libpng (requires zlib to be installed)
sqlite
zlib
mxml
expat
libxml2
jansson
physfs (requires zlib to be installed)
libmad
libogg
libvorbis (requires libogg to be installed)
giflib
libconfig
bzip2
xz
libarchive
nettle
wslay
+ make libarchive
wget -O libarchive-3.1.2.tar.gz "http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz"--2017-08-02 16:36:34--  http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz
Resolving www.libarchive.org (www.libarchive.org)... 2600:9000:2025:5a00:16:e6b0:f440:93a1, 2600:9000:2025:fe00:16:e6b0:f440:93a1, 2600:9000:2025:2600:16:e6b0:f440:93a1, ...
Connecting to www.libarchive.org (www.libarchive.org)|2600:9000:2025:5a00:16:e6b0:f440:93a1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4527540 (4.3M) [application/x-gzip]
Saving to: ‘libarchive-3.1.2.tar.gz’

2017-08-02 16:36:40 (54.6 MB/s) - ‘libarchive-3.1.2.tar.gz’ saved [4527540/4527540]

patching file libarchive/archive_ppmd7.c
patching file libarchive/archive_read_disk_posix.c
patching file libarchive/archive_write_disk_posix.c
patching file libarchive/archive_write_set_format_iso9660.c
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-none-eabi-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-none-eabi
checking for arm-none-eabi-gcc... arm-none-eabi-gcc
checking whether the C compiler works... no
configure: error: in `/home/eddy/Documents/FreeShop/arc13/freeshop/3ds_portlibs/libarchive-3.1.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
Makefile:274: recipe for target 'libarchive' failed
make: *** [libarchive] Error 77

Судя по ошибке, мне кажется, что я компилирую приложение ARM в 64-битной системе, и из-за этого происходит сбой. Однако мне нужно скомпилировать исходный код в ARM, поскольку он должен быть установлен на Nintendo 3DS. Как я могу исправить эту ошибку, чтобы скомпилировать приложение?

Редактировать: я попытался настроить компилятор для root и получил эту ошибку:

-- Check for working C compiler: /opt/devkitPro/devkitARM/bin/arm-none-eabi-gcc -- broken
CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "/opt/devkitPro/devkitARM/bin/arm-none-eabi-gcc" is not able
to compile a simple test program.

It fails with the following output:

Change Dir: /home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeTmpRun Build Command:"/usr/bin/make" "cmTC_ef3eb/fast"
/usr/bin/make -f CMakeFiles/cmTC_ef3eb.dir/build.make
CMakeFiles/cmTC_ef3eb.dir/build

make[1]: Entering directory
'/home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeTmp'

Building C object CMakeFiles/cmTC_ef3eb.dir/testCCompiler.c.o

/opt/devkitPro/devkitARM/bin/arm-none-eabi-gcc -o
CMakeFiles/cmTC_ef3eb.dir/testCCompiler.c.o -c
/home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeTmp/testCCompiler.cLinking C executable cmTC_ef3eb

/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ef3eb.dir/link.txt
--verbose=1

/opt/devkitPro/devkitARM/bin/arm-none-eabi-gcc
CMakeFiles/cmTC_ef3eb.dir/testCCompiler.c.o -o cmTC_ef3eb -rdynamic

arm-none-eabi-gcc: error: unrecognized command line option '-rdynamic'

CMakeFiles/cmTC_ef3eb.dir/build.make:97: recipe for target 'cmTC_ef3eb'
failed

make[1]: *** [cmTC_ef3eb] Error 1

make[1]: Leaving directory
'/home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeTmp'

Makefile:126: recipe for target 'cmTC_ef3eb/fast' failed

make: *** [cmTC_ef3eb/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:7 (project)-- Configuring incomplete, errors occurred!
See also "/home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeOutput.log".
See also "/home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeError.log".

Я также получаю эту ошибку:

-- strip: /opt/devkitPro/devkitARM/bin/arm-none-eabi-strip - found
-- 3dslink: /opt/devkitPro/devkitARM/bin/3dslink - found
-- Looking for Picasso...
-- Picasso: /opt/devkitPro/devkitARM/bin/picasso - found
-- Looking for nihstro...
-- nihstro - not found
CMake Error at /home/eddy/Documents/FreeShop/cpp3ds/cmake/template_emu/CMakeLists.txt:1 (find_package):
By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"Qt5Widgets", but CMake did not find one.

Could not find a package configuration file provided by "Qt5Widgets" with
any of the following names:

Qt5WidgetsConfig.cmake
qt5widgets-config.cmake

Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set
"Qt5Widgets_DIR" to a directory containing one of the above files.  If
"Qt5Widgets" provides a separate development package or SDK, be sure it has
been installed.-- Configuring incomplete, errors occurred!
See also "/home/eddy/Documents/FreeShop/arc13/freeshop/build/CMakeFiles/CMakeOutput.log".

0

Решение

От этот вопрос, похоже, что он не работает, так как не может найти правильный компилятор.

Вам нужно будет скачать кросс-компилятор, чтобы скомпилировать код для одной архитектуры на другой. Вы можете следовать инструкциям в этот вопрос, чтобы получить компилятор ARM, а затем ./configure Скрипт может работать сам по себе (похоже, он ищет кросс-компилятор), или вы можете использовать, например:

export CC=arm-linux-gnueabi-gcc
export CXX=arm-linux-gnueabi-g++

…перед запуском ./configure установить компиляторы для системы сборки (при условии, что она подчиняется CC конвенции).

Если это не сработает, вам могут понадобиться конкретные кросс-компиляторы DS, а не просто общие ARM. Возможно, стоит посмотреть на этот сайт если вы еще не сделали, чтобы увидеть, если их devkitARM предоставляет кросс-компилятор, который вам нужен.

редактировать: Если вы внимательно посмотрите на ваш новый вывод, вы увидите make CC=DEVKITPRO, Это зовет make непосредственно с DEVKITPRO установить в качестве компилятора, переопределяя любые попытки изменить компилятор заранее.

Вы должны убедиться, что DEVKITPRO бинарный доступен из вашего PATH — откройте терминал и введите DEVKITPRO и посмотрите, сможете ли вы его выполнить или он не найден. Если он не найден, проверьте инструкции на devkitARM на страницу, указанную выше, чтобы убедиться, что вы установили ее так, как они ожидали, в частности строку в инструкции по установке Linux, в которой говорится echo "export DEVKITPRO=/opt/devkitPro" >> ~/.bashrc,

Редактировать Редактировать: Есть список библиотек и наборов инструментов Вот. Посмотрите на странице установки вашего проекта, чтобы найти какие-либо зависимости, отследить их и установить их.

2

Другие решения

Других решений пока нет …

View previous topic :: View next topic  
Author Message
honeymak
Guru
Guru

Joined: 30 Dec 2002
Posts: 485

PostPosted: Sat Nov 29, 2014 1:55 pm    Post subject: zlib — no-multilib Reply with quote

Code:
g64 ~ # emerge zlib

 * IMPORTANT: 8 news items need reading for repository ‘gentoo’.

 * Use eselect news to read news items.

Calculating dependencies… done!

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) sys-libs/zlib-1.2.8-r1

 * zlib-1.2.8.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) …                                                                                                                                                                       [ ok ]

>>> Unpacking source…

>>> Unpacking zlib-1.2.8.tar.gz to /var/tmp/portage/sys-libs/zlib-1.2.8-r1/work

>>> Source unpacked in /var/tmp/portage/sys-libs/zlib-1.2.8-r1/work

>>> Preparing source in /var/tmp/portage/sys-libs/zlib-1.2.8-r1/work/zlib-1.2.8 …

 * Will copy sources from /var/tmp/portage/sys-libs/zlib-1.2.8-r1/work/zlib-1.2.8

 * abi_x86_64.amd64: copying to /var/tmp/portage/sys-libs/zlib-1.2.8-r1/work/zlib-1.2.8-abi_x86_64.amd64

>>> Source prepared.

>>> Configuring source in /var/tmp/portage/sys-libs/zlib-1.2.8-r1/work/zlib-1.2.8 …

 * abi_x86_64.amd64: running multilib-minimal_abi_src_configure

./configure —shared —prefix=/usr —libdir=/usr/lib64 —uname=linux

Using x86_64-pc-linux-gnu-ar

Using x86_64-pc-linux-gnu-ranlib

Using x86_64-pc-linux-gnu-nm

Checking for x86_64-pc-linux-gnu-gcc…

Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).

** ./configure aborting.

 * ERROR: sys-libs/zlib-1.2.8-r1::gentoo failed (configure phase):

 *   (no error message)

 *

 * Call stack:

 *     ebuild.sh, line   93:  Called src_configure

 *   environment, line 3252:  Called multilib-minimal_src_configure

 *   environment, line 2495:  Called multilib_parallel_foreach_abi ‘multilib-minimal_abi_src_configure’

 *   environment, line 2801:  Called multibuild_parallel_foreach_variant ‘_multilib_multibuild_wrapper’ ‘multilib-minimal_abi_src_configure’

 *   environment, line 2388:  Called multibuild_foreach_variant ‘_multibuild_parallel’ ‘_multilib_multibuild_wrapper’ ‘multilib-minimal_abi_src_configure’

 *   environment, line 2331:  Called _multibuild_run ‘_multibuild_parallel’ ‘_multilib_multibuild_wrapper’ ‘multilib-minimal_abi_src_configure’

 *   environment, line 2329:  Called _multibuild_parallel ‘_multilib_multibuild_wrapper’ ‘multilib-minimal_abi_src_configure’

 *   environment, line 2379:  Called _multilib_multibuild_wrapper ‘multilib-minimal_abi_src_configure’

 *   environment, line  491:  Called multilib-minimal_abi_src_configure

 *   environment, line 2489:  Called multilib_src_configure

 *   environment, line 2936:  Called die

 * The specific snippet of code:

 *               echoit ./configure —shared —prefix=»${EPREFIX}/usr» —libdir=»${EPREFIX}/usr/$(get_libdir)» ${uname:+—uname=${uname}} || die

 *

 * If you need support, post the output of `emerge —info ‘=sys-libs/zlib-1.2.8-r1::gentoo’`,

 * the complete build log and the output of `emerge -pqv ‘=sys-libs/zlib-1.2.8-r1::gentoo’`.

 * The complete build log is located at ‘/var/tmp/portage/sys-libs/zlib-1.2.8-r1/temp/build.log’.

 * The ebuild environment file is located at ‘/var/tmp/portage/sys-libs/zlib-1.2.8-r1/temp/environment’.

 * Working directory: ‘/var/tmp/portage/sys-libs/zlib-1.2.8-r1/work/zlib-1.2.8-abi_x86_64.amd64’

 * S: ‘/var/tmp/portage/sys-libs/zlib-1.2.8-r1/work/zlib-1.2.8’

>>> Failed to emerge sys-libs/zlib-1.2.8-r1, Log file:

>>>  ‘/var/tmp/portage/sys-libs/zlib-1.2.8-r1/temp/build.log’

 * Messages for package sys-libs/zlib-1.2.8-r1:

 * ERROR: sys-libs/zlib-1.2.8-r1::gentoo failed (configure phase):

 *   (no error message)

 *

 * Call stack:

 *     ebuild.sh, line   93:  Called src_configure

 *   environment, line 3252:  Called multilib-minimal_src_configure

 *   environment, line 2495:  Called multilib_parallel_foreach_abi ‘multilib-minimal_abi_src_configure’

 *   environment, line 2801:  Called multibuild_parallel_foreach_variant ‘_multilib_multibuild_wrapper’ ‘multilib-minimal_abi_src_configure’

 *   environment, line 2388:  Called multibuild_foreach_variant ‘_multibuild_parallel’ ‘_multilib_multibuild_wrapper’ ‘multilib-minimal_abi_src_configure’

 *   environment, line 2331:  Called _multibuild_run ‘_multibuild_parallel’ ‘_multilib_multibuild_wrapper’ ‘multilib-minimal_abi_src_configure’

 *   environment, line 2329:  Called _multibuild_parallel ‘_multilib_multibuild_wrapper’ ‘multilib-minimal_abi_src_configure’

 *   environment, line 2379:  Called _multilib_multibuild_wrapper ‘multilib-minimal_abi_src_configure’

 *   environment, line  491:  Called multilib-minimal_abi_src_configure

 *   environment, line 2489:  Called multilib_src_configure

 *   environment, line 2936:  Called die

 * The specific snippet of code:

 *               echoit ./configure —shared —prefix=»${EPREFIX}/usr» —libdir=»${EPREFIX}/usr/$(get_libdir)» ${uname:+—uname=${uname}} || die

 *

 * If you need support, post the output of `emerge —info ‘=sys-libs/zlib-1.2.8-r1::gentoo’`,

 * the complete build log and the output of `emerge -pqv ‘=sys-libs/zlib-1.2.8-r1::gentoo’`.

 * The complete build log is located at ‘/var/tmp/portage/sys-libs/zlib-1.2.8-r1/temp/build.log’.

 * The ebuild environment file is located at ‘/var/tmp/portage/sys-libs/zlib-1.2.8-r1/temp/environment’.

 * Working directory: ‘/var/tmp/portage/sys-libs/zlib-1.2.8-r1/work/zlib-1.2.8-abi_x86_64.amd64’

 * S: ‘/var/tmp/portage/sys-libs/zlib-1.2.8-r1/work/zlib-1.2.8’



Code:
g64 ~ # emerge —info ‘=sys-libs/zlib-1.2.8-r1::gentoo’

Portage 2.2.8-r2 (default/linux/amd64/13.0/no-multilib, gcc-4.8.3, glibc-2.19-r1, 3.16.5-gentoo x86_64)

=================================================================

                         System Settings

=================================================================

System uname: Linux-3.16.5-gentoo-x86_64-QEMU_Virtual_CPU_version_-cpu64-rhel6-with-gentoo-2.2

KiB Mem:     4053364 total,   2740640 free

KiB Swap:    4000244 total,   4000244 free

Timestamp of tree: Fri, 28 Nov 2014 13:00:01 +0000

ld GNU ld (Gentoo 2.24 p1.4) 2.24

app-shells/bash:          4.2_p53

dev-lang/perl:            5.18.2-r2

dev-lang/python:          2.7.7, 3.3.5-r1, 3.4.1

dev-util/pkgconfig:       0.28-r1

sys-apps/baselayout:      2.2

sys-apps/openrc:          0.12.4

sys-apps/sandbox:         2.6-r1

sys-devel/autoconf:       2.69

sys-devel/automake:       1.13.4

sys-devel/binutils:       2.24-r3

sys-devel/gcc:            4.8.3

sys-devel/gcc-config:     1.7.3

sys-devel/libtool:        2.4.2-r1

sys-devel/make:           4.0-r1

sys-kernel/linux-headers: 3.16 (virtual/os-headers)

sys-libs/glibc:           2.19-r1

Repositories: gentoo

ACCEPT_KEYWORDS=»amd64″

ACCEPT_LICENSE=»* -@EULA»

CBUILD=»x86_64-pc-linux-gnu»

CFLAGS=»-O3 -march=native -mtune=native -fomit-frame-pointer -pipe»

CHOST=»x86_64-pc-linux-gnu»

CONFIG_PROTECT=»/etc»

CONFIG_PROTECT_MASK=»/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo»

CXXFLAGS=»-O3 -march=native -mtune=native -fomit-frame-pointer -pipe»

DISTDIR=»/usr/portage/distfiles»

FCFLAGS=»-O2 -pipe»

FEATURES=»assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync»

FFLAGS=»-O2 -pipe»

GENTOO_MIRRORS=»http://gentoo.aditsu.net:8000″

LANG=»en_HK.UTF-8″

LDFLAGS=»-Wl,-O1 -Wl,—as-needed»

PKGDIR=»/usr/portage/packages»

PORTAGE_CONFIGROOT=»/»

PORTAGE_RSYNC_OPTS=»—recursive —links —safe-links —perms —times —omit-dir-times —compress —force —whole-file —delete —stats —human-readable —timeout=180 —exclude=/distfiles —exclude=/local —exclude=/packages»

PORTAGE_TMPDIR=»/var/tmp»

PORTDIR=»/usr/portage»

PORTDIR_OVERLAY=»»

USE=»acl amd64 berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm iconv ipv6 mmx modules ncurses nls nptl openmp pam pcre readline session sse sse2 ssl tcpd unicode zlib» ABI_X86=»64″ ALSA_CARDS=»ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci» APACHE2_MODULES=»authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias» CALLIGRA_FEATURES=»kexi words flow plan sheets stage tables krita karbon braindump author» CAMERAS=»ptp2″ COLLECTD_PLUGINS=»df interface irq load memory rrdtool swap syslog» ELIBC=»glibc» GPSD_PROTOCOLS=»ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx» GRUB_PLATFORMS=»pc» INPUT_DEVICES=»keyboard mouse evdev» KERNEL=»linux» LCD_DEVICES=»bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text» LIBREOFFICE_EXTENSIONS=»presenter-console presenter-minimizer» OFFICE_IMPLEMENTATION=»libreoffice» PHP_TARGETS=»php5-5″ PYTHON_SINGLE_TARGET=»python2_7″ PYTHON_TARGETS=»python2_7 python3_3″ RUBY_TARGETS=»ruby19 ruby20″ USERLAND=»GNU» VIDEO_CARDS=»fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l» XTABLES_ADDONS=»quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account»

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON

=================================================================

                        Package Settings

=================================================================

sys-libs/zlib-1.2.8-r1 was built with the following:

USE=»static-libs -minizip»

CFLAGS=»-O3 -fomit-frame-pointer -pipe -mtune=native -march=core-avx2″



Code:
g64 ~ # cat /proc/cpuinfo

processor   : 0

vendor_id   : GenuineIntel

cpu family   : 6

model      : 13

model name   : QEMU Virtual CPU version (cpu64-rhel6)

stepping   : 3

microcode   : 0x1

cpu MHz      : 1995.191

cache size   : 4096 KB

physical id   : 0

siblings   : 1

core id      : 0

cpu cores   : 1

apicid      : 0

initial apicid   : 0

fpu      : yes

fpu_exception   : yes

cpuid level   : 4

wp      : yes

flags      : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm nopl pni cx16 hypervisor lahf_lm

bogomips   : 3991.64

clflush size   : 64

cache_alignment   : 64

address sizes   : 46 bits physical, 48 bits virtual

power management:

i would like to change to CFLAGS=»-O3 -fomit-frame-pointer -pipe -mtune=native -march=native»

this cflags compiles gcc, glibc successfully but when I emerge world -Deu and started with zlib

it does not work

and emerge zlib itself does not work

unless i change the -march to anything but native

any clue for that? i m no-multilib coz i m not doing this thing as workstation or gui stuff…….i think my ‘use-case’ should be 32bit worry-free?….any opinions welcome

:wink:
_________________
hackers — make sth real

academics — read sth said to be real

Back to top

View user's profile Send private message

quilosaq
Veteran
Veteran

Joined: 22 Dec 2009
Posts: 1472

PostPosted: Sat Nov 29, 2014 8:40 pm    Post subject: Reply with quote

Have you a symlink from /lib to /lib64?
Back to top

View user's profile Send private message

NeddySeagoon
Administrator
Administrator

Joined: 05 Jul 2003
Posts: 51961
Location: 56N 3W

PostPosted: Sat Nov 29, 2014 9:00 pm    Post subject: Reply with quote

honeymak,

Code:
model name   : QEMU Virtual CPU version (cpu64-rhel6)



I don’t think -march=native will work on that CPU. I’ve had problems in KVMs using binaries built on the bare metal with -march=native.

Either virt-manager told me that there was a problem and refused to start the KVM, or it would start, then have problems with a few bare metal packages.

The eventual fix was to edit /etc/libvirt/qemu/Mailserver.xml for my Mailserver KVM with virsh edit, to fix it. The fix was machine=’pc-0.14′ from ‘pc-i440fx-2.1’

With some contex … Works

Code:
  <os>

    <type arch=’x86_64′ machine=’pc-0.14′>hvm</type>

    <bootmenu enable=’yes’/>

  </os>



Fails

Code:
  <os>

    <type arch=’x86_64′ machine=’pc-i440fx-2.1′>hvm</type>

    <bootmenu enable=’yes’/>

  </os>



Tell us more about your bare metal and virtualisation set up.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-

those that do backups

those that have never had a hard drive fail.

Back to top

View user's profile Send private message

Ant P.
Watchman
Watchman

Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sat Nov 29, 2014 9:47 pm    Post subject: Reply with quote

-fomit-frame-pointer is implied by -O1. You should remove it.
Back to top

View user's profile Send private message

mv
Watchman
Watchman

Joined: 20 Apr 2005
Posts: 6623

PostPosted: Sun Nov 30, 2014 2:46 pm    Post subject: Reply with quote

Ant P. wrote:
-fomit-frame-pointer is implied by -O1



No, this is a frequent misunderstanding of the manpage: It is implied on architectures where it does not interfere with debugging. I never checked which architectures these are, but the popular x86 and amd64 do not belong to this class.

Back to top

View user's profile Send private message

Ant P.
Watchman
Watchman

Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sun Nov 30, 2014 3:13 pm    Post subject: Reply with quote

mv wrote:
Ant P. wrote:
-fomit-frame-pointer is implied by -O1



No, this is a frequent misunderstanding of the manpage: It is implied on architectures where it does not interfere with debugging. I never checked which architectures these are, but the popular x86 and amd64 do not belong to this class.



Maybe my gcc’s manpage has a misprint?

man gcc:

           Starting with GCC version 4.6, the default setting (when not

           optimizing for size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86

           targets has been changed to -fomit-frame-pointer.  The default can

           be reverted to -fno-omit-frame-pointer by configuring GCC with the

           —enable-frame-pointer configure option.

           Enabled at levels -O, -O2, -O3, -Os.

Back to top

View user's profile Send private message

mv
Watchman
Watchman

Joined: 20 Apr 2005
Posts: 6623

PostPosted: Sun Nov 30, 2014 3:19 pm    Post subject: Reply with quote

Ant P. wrote:
Maybe my gcc’s manpage has a misprint?



Somehow I had missed that change concerning x86. Thanks. This is why I like this forum.

However, what about amd64?

Back to top

View user's profile Send private message

Ant P.
Watchman
Watchman

Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sun Nov 30, 2014 3:31 pm    Post subject: Reply with quote

-fomit-frame-pointer has always been enabled for amd64:

Code:
~ $ gcc -Q -v -O1 -x c /dev/null 2>&1 | grep ‘ -fo’

 -fmerge-debug-strings -fmove-loop-invariants -fomit-frame-pointer

Back to top

View user's profile Send private message

honeymak
Guru
Guru

Joined: 30 Dec 2002
Posts: 485

PostPosted: Mon Dec 01, 2014 2:00 am    Post subject: Reply with quote

sorry for late reply guys

i used to have virtualbox host with gentoo guest which is running ‘-march=native’ inside gentoo guest (while windows virtualbox as the host ;D)

just wondering if any trend for kvm to get ‘-march=native’ possible inside guest gcc compile? XP

and if -march=native is not possible inside guest, what’s the best choice? i am running xeon E5 stuff as host

and i know -march=native mentioned ‘the compiled output possibly not be able running in another machine’ but do u guys think it’s possible to run in another kvm guest? i mean if i make this gentoo guest in my xeon with ‘native’ QEMU cpu and then i move this guest into another machine with the same QEMU cpu……then do u guys think it’s runnable?…..hm……just wondering 8) :lol:
_________________
hackers — make sth real

academics — read sth said to be real

Back to top

View user's profile Send private message

NeddySeagoon
Administrator
Administrator

Joined: 05 Jul 2003
Posts: 51961
Location: 56N 3W

PostPosted: Mon Dec 01, 2014 7:40 pm    Post subject: Reply with quote

honeymak,

Moving KVMs is not as issue. Its how you set them up in the first place.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-

those that do backups

those that have never had a hard drive fail.

Back to top

View user's profile Send private message

honeymak
Guru
Guru

Joined: 30 Dec 2002
Posts: 485

PostPosted: Tue Dec 02, 2014 1:59 pm    Post subject: Reply with quote

ic……..

i am setting the guest -march=corei7 without using kvm host ‘copy host cpu’ feature

seems the guest is running ok…… 8) :oops:
_________________
hackers — make sth real

academics — read sth said to be real
Back to top

View user's profile Send private message

Display posts from previous:   

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Today I tried to compile ProFTPd with some additional modules (for example: mod_quotatab). However, after configuring and trying to compile the project, I received an error message. It said something like /usr/bin/ld: cannot find -lz . I googled for this error message and found out, it was caused by a library called zlib, so I decided to install it ^^

1. Download the installation package (if the link doesn’t work, simply visit their website here)(Thanks to srinivasu for the updated link):
wget http://www.zlib.net/zlib-1.2.8.tar.gz

2. After downloading the package, extract it like that :
tar -xvzf zlib-1.2.8.tar.gz

3. Change to the directory we just created :
cd zlib-1.2.8

4. Configure the zlib library :
./configure --prefix=/usr/local/zlib

5. Compile it :
make

6. Install it :
sudo make install

That’s it, zlib should be installed properly

EDIT:
And here’s how to install the HEADER files of zlib. They’re needed when compiling several applications from source.

aptitude install zlib1g-dev

Понравилась статья? Поделить с друзьями:
  • Compiler error cs1106
  • Compiler error cs1061
  • Compiler error cs1012
  • Compiler error cs0501
  • Compiler error cs0433