Error building LAPACK on Redhat 4.1 - installation

I am trying to build LAPACK (the full version) with ATLAS on Redhat 4.1. I have been successful in building ATLAS depending upon the tarfile of lapack:
atlas/configure --prefix=HOME/atlas --with-netlib-lapack-tarfile=HOME/lapack-3.4.1.tgz
make build
make check
make install
But I need the whole installation of LAPACK. I found
http://math-atlas.sourceforge.net/atlas_install/atlas_install.html
and
http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CGcQFjAA&url=http%3A%2F%2Fciteseerx.ist.psu.edu%2Fviewdoc%2Fdownload%3Fdoi%3D10.1.1.136.5309%26rep%3Drep1%26type%3Dpdf&ei=3C8YUKaqOIqm8AT6kYC4Cg&usg=AFQjCNHKbHg1H0qupmzQbj9tGq3tsmXRDQ&sig2=etIB36nxjasjUg4sEwQ0DQ
which suggest changing a few lines of the default make.inc.example to build the rest of LAPACK. However, I am unsuccessful in getting even the default build of LAPACK to work:
cp make.inc.example make.inc
compute-1-29.local make
( cd INSTALL; make; ./testlsame; ./testslamch; ./testdlamch; \
./testsecond; ./testdsecnd; ./testieee; ./testversion )
make[1]: Entering directory `/home/jmorgens/lap/lapack/INSTALL'
gfortran -O0 -c slamch.f -o slamch.o
/share/apps/gcc-trunk/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.2.0/f951: error while loading shared libraries: libmpfr.so.1: cannot open shared object file: No such file or directory
make[1]: *** [slamch.o] Error 1
make[1]: Leaving directory `/home/jmorgens/lap/lapack/INSTALL'
ASCII character set
Tests completed
/bin/sh: ./testslamch: No such file or directory
/bin/sh: ./testdlamch: No such file or directory
/bin/sh: ./testsecond: No such file or directory
/bin/sh: ./testdsecnd: No such file or directory
/bin/sh: ./testieee: No such file or directory
/bin/sh: ./testversion: No such file or directory
make: *** [lapack_install] Error 127
Suggestions?

Related

How to compile tool and samples from within the kernel source tree? (e.g. bpftool, bpf samples)

GOAL: compile samples/bpf, compile bpf/bpftool and use them.
PROBLEM: on a VM with Ubuntu 18.04 bionic with a kernel 4.18.0-25-generic I've installed kernel src code executing apt install linux-source-4.18.0.
Now I cd into /usr/src/linux-source-4.18.0/linux-source-4.18.0/samples/bpf and I run make and the result is
make -C ../../ /usr/src/linux-source-4.18.0/linux-source-4.18.0/samples/bpf/ BPF_SAMPLES_PATH=/usr/src/linux-source-4.18.0/linux-source-4.18.0/samples/bpf
make[1]: Entering directory '/usr/src/linux-source-4.18.0/linux-source-4.18.0'
scripts/kconfig/conf --syncconfig Kconfig
***
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
scripts/kconfig/Makefile:40: recipe for target 'syncconfig' failed
make[3]: *** [syncconfig] Error 1
Makefile:562: recipe for target 'syncconfig' failed
make[2]: *** [syncconfig] Error 2
make[1]: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/kernel.release'. Stop.
make[1]: Leaving directory '/usr/src/linux-source-4.18.0/linux-source-4.18.0'
Makefile:203: recipe for target 'all' failed
make: *** [all] Error 2
If I cd into ../samples/bpf and I run sudo make the result is
Auto-detecting system features:
... libbfd: [ OFF ]
... disassembler-four-args: [ OFF ]
CC map_perf_ring.o
CC xlated_dumper.o
CC perf.o
CC cfg.o
CC common.o
CC cgroup.o
CC main.o
main.c:36:10: fatal error: bfd.h: No such file or directory
#include <bfd.h>
^~~~~~~
compilation terminated.
Makefile:92: recipe for target 'main.o' failed
make: *** [main.o] Error 1
QUESTIONS: what am I missing? After I compile them if I want to write a program which, for example, needs to use bpftool I have to write the program inside the source kernel directory or I can write it everywhere?
Build errors
The first case (Makefile:562: recipe for target 'syncconfig' failed) fails because you run make from the top of the linux kernel repository, and before trying to compile the samples, the build system tries to load a config file to use for your system (but does not find one).
Before trying to build the samples (make -C samples/bpf), you can create a .config file from your current kernel configuration like this:
$ cp /usr/src/linux-headers-$(uname -r)/.config <path to repo>/.config
$ make olddefconfig
Or even simply generate a default config file from scratch:
$ make defconfig
See make help from top directory to see the available make options.
Your second error, regarding bfd.h not found, is that you miss a library. Libbfd on Ubuntu comes with binutils-dev, so apt install binutils-dev should do the trick.
Compiling the programs
Finally, regarding your question on compiling the programs:
You can write and build program from the kernel repository, just by creating a new sample and reusing the existing Makefiles.
You can also write and compile programs outside of the kernel tree. The basic clang (v4.0 or above, if possible v6.0 or above) command to compile them usually looks something like this:
$ clang -O2 -emit-llvm -c my_bpf_prog.c -o - | \
llc -march=bpf -filetype=obj -o my_bpf_prog.o
You can find examples of programs compiled out of the kernel tree in that repository (disclaimer: by my company) or in the XDP tutorial repo.

Unable to build glibc

I'm trying to build glibc 2.27 as a static library from sources on Ubuntu 18.04. This is the command I am using(after making a separate build directory for glibc):
$ git clone git://sourceware.org/git/glibc.git && cd glibc
$ git checkout release/2.27/master
$ cd ..
$ mkdir glibc-build && cd glibc-build
$ ../glibc/configure --enable-kernel=4.4 --disable-shared --enable-static --enable-static-nss --prefix=/usr
$ make
make results in this error:
cc1: fatal error: /home/parallels/glibc-build/libc-modules.h: No such file or directory
compilation terminated.
../Makerules:281: recipe for target '/home/parallels/glibc-build/ucontext_i.h' failed
make[2]: *** [/home/parallels/glibc-build/ucontext_i.h] Error 1
make[2]: Leaving directory '/home/parallels/glibc/csu'
Makefile:215: recipe for target 'csu/subdir_lib' failed
make[1]: *** [csu/subdir_lib] Error 2
make[1]: Leaving directory '/home/parallels/glibc'
Makefile:9: recipe for target 'all' failed
make: *** [all] Error 2
Full log for make
I am running Ubuntu 18.04 and am using the preinstalled versions of gcc and make.
This is a known issue:
Unable to build GLIBC with --disable-shared
In general, this is not a problem because a default build (without --disable-shared) builds both the static and dynamically linked version of the library, and make install DESTDIR=… installs both.

Cannot find a link library (lNrrdIO)

I am trying to install NrrdIO on Ubuntu 18.04, to run Marching Cubes to segment medical images. This is the link from which I'm trying to run it.
http://web.cse.ohio-state.edu/research/graphics/isotable/
I'm trying to install ijkmcube-v0-3-3.tar, which requires the ITKNrrdIO.a library. I'm running into this error:
[ 7%] Linking CXX executable ijkmcube
/usr/bin/ld: cannot find -lNrrdIO
collect2: error: ld returned 1 exit status
CMakeFiles/ijkmcube.dir/build.make:406: recipe for target 'ijkmcube' failed
make[2]: *** [ijkmcube] Error 1
CMakeFiles/Makefile2:131: recipe for target 'CMakeFiles/ijkmcube.dir/all' failed
make[1]: *** [CMakeFiles/ijkmcube.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
I've installed NrrdIO 1.11.0, and tried with NrrdIO 1.9.0 as well, but while running
make
I always run into this error, for some reason its not able to find lNrrdIO . Can someone please help?
Thanks
Edit:
I think its a problem with the linking, but when I copied the NrrdIO.a file to /usr/bin and modified the symbolic link to point to it, I got an error as follows:
[ 7%] Linking CXX executable ijkmcube
collect2: fatal error: cannot find 'ld'
compilation terminated.
CMakeFiles/ijkmcube.dir/build.make:406: recipe for target 'ijkmcube'
failed
make[2]: *** [ijkmcube] Error 1
CMakeFiles/Makefile2:131: recipe for target '
CMakeFiles/ijkmcube.dir/all' failed
make[1]: *** [CMakeFiles/ijkmcube.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Can someone help? Thank you
Edit 2
PROJECT(IJKMCUBE)
#---------------------------------------------------------
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
IF (NOT DEFINED ${IJK_DIR})
GET_FILENAME_COMPONENT(IJK_ABSOLUTE_PATH "../.." ABSOLUTE)
SET(IJK_DIR ${IJK_ABSOLUTE_PATH} CACHE PATH "IJK directory")
ENDIF (NOT DEFINED ${IJK_DIR})
SET(CMAKE_INSTALL_PREFIX "${IJK_DIR}/")
SET(LIBRARY_OUTPUT_PATH ${IJK_DIR}/lib CACHE PATH "Library directory")
SET(IJKMCUBE_DIR "src/ijkmcube")
SET(NRRD_LIBDIR "${IJK_DIR}/lib")
SET(IJK_ISOTABLE_DIR "${IJK_DIR}/isotable" CACHE PATH "Isotable
directory")
#---------------------------------------------------------
IF (NOT CMAKE_BUILD_TYPE)
SET (CMAKE_BUILD_TYPE Release CACHE STRING
"Default build type: Release" FORCE)
ENDIF (NOT CMAKE_BUILD_TYPE)
INCLUDE_DIRECTORIES("${IJK_DIR}/include")
LINK_DIRECTORIES("${NRRD_LIBDIR}")
LINK_LIBRARIES(expat NrrdIO z)
ADD_DEFINITIONS(-DIJK_ISOTABLE_DIR=\"${IJK_ISOTABLE_DIR}\")
ADD_EXECUTABLE(ijkmcube ijkmcube_main.cxx ijkmcubeIO.cxx ijkmcube.cxx
ijkmcube_datastruct.cxx ijkmcube_sub.cxx
ijkmcube_extract.cxx ijkmcube_util.cxx
ijksnapmc.cxx
ijktable.cxx ijktable_poly.cxx ijktable_ambig.cxx
ijkoctree.cxx ijkxitIO.cxx)
ADD_LIBRARY(ijkmcubeL STATIC EXCLUDE_FROM_ALL ijkmcubeIO.cxx
ijkmcube.cxx ijkmcube_datastruct.cxx ijkmcube_sub.cxx
ijkmcube_extract.cxx ijkmcube_util.cxx ijksnapmc.cxx
ijktable.cxx ijkoctree.cxx ijkxitIO.cxx)
SET_TARGET_PROPERTIES(ijkmcubeL PROPERTIES OUTPUT_NAME ijkmcube)
ADD_CUSTOM_TARGET(lib DEPENDS ijkmcubeL)
SET(CMAKE_INSTALL_PREFIX ${IJK_DIR})
INSTALL(TARGETS ijkmcube DESTINATION "bin/linux")
ADD_CUSTOM_TARGET(tar WORKING_DIRECTORY ../.. COMMAND tar cvfh
${IJKMCUBE_DIR}/ijkmcube.tar ${IJKMCUBE_DIR}/README
${IJKMCUBE_DIR}/INSTALL ${IJKMCUBE_DIR}/RELEASE_NOTES
${IJKMCUBE_DIR}/*.cxx ${IJKMCUBE_DIR}/*.h ${IJKMCUBE_DIR}/*.txx
${IJKMCUBE_DIR}/CMakeLists.txt ${IJKMCUBE_DIR}/man/*
${IJKMCUBE_DIR}/ijkmcube_doxygen.config)
ADD_CUSTOM_TARGET(doc COMMAND doxygen ijkmcube_doxygen.config)
SOLVED
Tsyvarev solved it, the libNrrdIO.a file has to be copied to /usr/lib/. Refer to comments for the exact solution
This answer was given by #Tsyvarev:
By making a link named ld you are removing the original linker (ld). Without the linker you definitely cannot build any library. What you need is to make a link named lNrrdIO.a, so it will point to the actual library location: sudo ln -sfn /home/subham/Downloads/NrrdIO-1.9.0-src/lNrrdIO.a lNrrdIO.a (run this command from /usr/lib directory). And restore original /usr/bin/ld file.

Installation SystemC 2.3.2 failed

I want to install SystemC 2.3.2 on ubuntu 16.04 So i followd the install file directives:
2. Create a temporary directory, e.g.,
> mkdir objdir
3. Change to the temporary directory, e.g.,
> cd objdir
4. Choose your compiler by setting the CXX environment variable
> export CXX=g++
5. Configure the package for your system, e.g.,
(The configure script is explained below.)
> ../configure
In case you want to install the package in another place than the
top level directory (systemc-2.3.2), configure the package e.g. as
follows:
> ../configure --prefix=/usr/local/systemc-2.3.2
6. Compile the package.
> make
7. At this point you may wish to verify the compiled package by
testing the example suite.
> make check
8. Install the package.
> make install
9. You can now remove the temporary directory, .e.g,
> cd ..
> rm -rf objdir
every step went good until i reached step 8 to install the package ... i get the following error:
user#user-Lenovo-IdeaPad-Y510P:~/systemc-2.3.2/objdir$ make install
Making install in docs
make[1]: Entering directory '/home/anoir/systemc-2.3.2/objdir/docs'
make[2]: Entering directory '/home/anoir/systemc-2.3.2/objdir/docs'
make[2]: Nothing to be done for 'install-exec-am'.
/bin/mkdir -p '/usr/local/systemc-2.3.2/docs'
/bin/mkdir: cannot create directory ‘/usr/local/systemc-2.3.2’: Permission denied
Makefile:380: recipe for target 'install-nobase_docDATA' failed
make[2]: *** [install-nobase_docDATA] Error 1
make[2]: Leaving directory '/home/anoir/systemc-2.3.2/objdir/docs'
Makefile:453: recipe for target 'install-am' failed
make[1]: *** [install-am] Error 2
make[1]: Leaving directory '/home/anoir/systemc-2.3.2/objdir/docs'
Makefile:505: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
I don't understand the problem. What could be my mistake
Default install location need root access. If you don't have it. Try to install it to other location which you have right to access.
For example:
../configure --prefix ${HOME}/SystemC

linux/scripts/recordmcount: No such file or directory

When I try to make a kernel module of Linux, the following error message appears:
/home/mynfs/linux/scripts/recordmcount: No such file or directory
What's wrong with it?
PS: /home/mynfs/linux/ is the directory my source tree is in.
[root#localhost yiran]# make CONFIG_NFS_ACL_SUPPORT=m -C /home/mynfs/linux M=/home/mynfs/linux/fs/nfs_common modules
make: Entering directory `/home/mynfs/linux'
WARNING: Symbol version dump /home/mynfs/linux/Module.symvers
is missing; modules will have no dependencies and modversions.
CC [M] /home/mynfs/linux/fs/nfs_common/nfsacl.o
**/bin/sh: /home/mynfs/linux/scripts/recordmcount: No such file or directory**
make[1]: * [/home/mynfs/linux/fs/nfs_common/nfsacl.o] Error 1
make: * [_module_/home/mynfs/linux/fs/nfs_common] Error 2
make: Leaving directory `/home/mynfs/linux'
[root#localhost yiran]# ls /home/mynfs/linux/scripts | grep recordmcount
recordmcount.c
recordmcount.h
recordmcount.pl
I had the same problem, and just making recordmcount solved it partially. There were other scripts/* modules missing.
The following command built all the modules that were missing for me:
cd $(sysroot)/usr/src/linux (in your case it should be /home/mynfs/linux)
make scripts
Then all the scripts modules were built and I had no further problems compiling kernel modules.
you should build recordmcount by doing
make recordmcount
in /home/mynfs/linux/scripts

Resources