I'm currently trying to get Autotools to play nice with the D programming language. So far, I've had success with everything except dynamic libraries. I've written a skeleton project aiming to do this, but for some reason, after configure && make, I get the following error:
gdmd -m64 -inline -noboundscheck -g -property -w -wi -O -c -fPIC -ofsrc/foo.lo src/foo.d
/bin/sh ./libtool --tag=CC --mode=link -g -O2 -version-info 0:1:0 -o libfoo-0.1.la -rpath /usr/local/lib src/foo.lo
Usage: /home/koz/Documents/Programming/D/d-skeleton-lib/libtool [OPTION]... [MODE-ARG]...
Try 'libtool --help' for more information.
libtool: error: unrecognised option: '-g'
Makefile:435: recipe for target 'libfoo-0.1.la' failed
make: *** [libfoo-0.1.la] Error 1
I'm not sure why those flags are being passed to libtool at link time - could someone please help me understand what's going on and how to avoid this behaviour?
Related
I'm trying to upgrade xml-security-c-2.0.2. I extracted the tar file on my linux environment. I exported the following xerces environment variables below before the ./configure command:
Env variables:
export xerces_LIBS=/opt/shibboleth-sp/lib
export xerces_CFLAGS=/opt/shibboleth-sp/include
configure command:
./configure --without-xalan --disable-static --prefix=/opt/shibboleth-sp
Once I run make, I get the following error:
make[2]: Entering directory `/opt/build/xml-security-c-2.0.2/xsec'
g++ -DHAVE_CONFIG_H -I.. -I.. -DXSEC_BUILDING_TOOLS /opt/shibboleth-sp/include -Wall -O2 -DNDEBUG -pthread -MT tools/xtest/xsec_xtest-xtest.o -MD -MP -MF tools/xtest/.deps/xsec_xtest-xtest.Tpo -c -o tools/xtest/xsec_xtest-xtest.o `test -f 'tools/xtest/xtest.cpp' || echo './'`tools/xtest/xtest.cpp
In file included from tools/xtest/xtest.cpp:32:0:
**../xsec/framework/XSECDefs.hpp:63:39: fatal error: xercesc/util/XercesDefs.hpp: No such file or directory
#include <xercesc/util/XercesDefs.hpp>''**'
For whatever reason it cannot find the source file XercesDefs.hpp. This has been an issue for a month or so where we cannot figure out why it isn't finding that source file. When I run a find on this particular file, I get the following path showing it is indeed in multiple locations:
/opt/build/xerces-c-3.2.3/src/xercesc/util/XercesDefs.hpp
/opt/shibboleth-sp/include/xercesc/util/XercesDefs.hpp
Is there something in the compile process that is making this not work or not pick this up? Should I be exporting something else in order to pick up this file?
We currently have version xml-security-c-1.7.3 installed on the machine. Would it be easier to use this version? Is there some sort of bug with 2.0.2 or something that needs to be configured from going from version 1.x to 2.x?
This is all to upgrade shibboleth idp, and installing all the needed dependencies prior to Shibboleth build.
> current OS version Linux version 4.14.214-118.339.amzn1.x86_64
> (gcc version 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC)) #1 SMP
Any help is very much appreciated!
EDIT:
I've exported my CXXFLAGS to point at include however I'm still getting the following error when I issue the make command:
make all-recursive
make[1]: Entering directory `/opt/build/xml-security-c-2.0.2'
Making all in xsec
make[2]: Entering directory `/opt/build/xml-security-c-2.0.2/xsec'
/bin/sh ../libtool --tag=CXX --mode=link g++ /opt/shibboleth-sp/include -Wall /opt/shibboleth-sp/include -O2 -DNDEBUG -pthread -o xsec-xtest tools/xtest/xsec_xtest-xtest.o libxml-security-c.la /opt/shibboleth-sp/lib /opt/apache2_4_46/bin
libtool: link: g++ /opt/shibboleth-sp/include -Wall /opt/shibboleth-sp/include -O2 -DNDEBUG -pthread -o .libs/xsec-xtest tools/xtest/xsec_xtest-xtest.o /opt/shibboleth-sp/lib /opt/apache2_4_46/bin ./.libs/libxml-security-c.so -pthread -Wl,-rpath -Wl,/opt/shibboleth-sp/lib
/opt/shibboleth-sp/include: file not recognized: Is a directory
collect2: error: ld returned 1 exit status
make[2]: *** [xsec-xtest] Error 1
make[2]: Leaving directory `/opt/build/xml-security-c-2.0.2/xsec'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/build/xml-security-c-2.0.2'
make: *** [all] Error 2
What is going on with this?
RHEL 7.2 is the year 2015 update. Current is 7.8 (yum update).
XercesDefs.hpp: No such file
xml-security-c-2.0.2 configure will look in /usr/include, /usr/local/include ! When you have a "hide away" location, the INCLUDE path must be specified : See $ ./configure --help
Example : CXXFLAGS=-I/opt/shibboleth-sp/include , I.e. →
$ ./configure --prefix=/opt/shibboleth-sp CXXFLAGS=-I/opt/shibboleth-sp/include
Bugs : There are no bugs in xml-security-c-2.0.2 . Will compile without errors in EL 7 ( 3 minutes, g++73 (or with the default g++ ver. 4.8 )).
Ref your comment »» I need the .tar.gz files «« : Please follow the link https://ftp.gwdg.de/pub/opensuse/repositories/home%3A/Scott_Cantor/CentOS_7/ → src/
Example $ bash unPack_rpm.sh xml-security-c-2.0.2-4.2.src.rpm and you get xml-security-c-2.0.2-4.2.src/{xml-security-c-2.0.2.tar.bz2 , xml-security-c.spec}
Script unPack_rpm.sh https://drive.google.com/file/d/1q3d9QqrRhEThYByPDgWEaoxHnqWFWqfE/view?usp=sharing
Get build-deps : # yum-builddep xml-security-c.spec
When I tried to run example of gRPC for c++ in folder grpc/examples/cpp/helloworld it requires libraries which weren't compiled when I built gRPC with Cmake
Firstly I built gRPC in Ububtu 16.04 with instructions:
$ git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc
$ cd grpc
$ git submodule update --init
$ cd third_party/protobuf
$ git submodule update --init --recursive
$ ./autogen.sh
$ ./configure --prefix=/usr
$ make
$ make check
$ sudo make install
$ sudo ldconfig # refresh shared library cache.
$ pkg-config --cflags protobuf # print compiler flags
$ pkg-config --libs protobuf # print linker flags
$ pkg-config --cflags --libs protobuf # print both
cd ../..
make
sudo make install
After that I tried to run example in folder grpc/examples/cpp/helloworld
grps/grpc/examples/cpp/helloworld$ make
i got several mistakes, which were resolved by copying grpc_cpp_plugin from folder grpc/bins/opt to /usr/local/bin and grpc++.pc and grpc++_unsecure.pc from grpc/libs/opt/pkgconfig/ to /usr/local/lib/pkgconfig.
When I tried for the next time command
grpc/examples/cpp/helloworld$ make
I've got message
g++ helloworld.pb.o helloworld.grpc.pb.o greeter_client.o -L/usr/local/lib `pkg-config --libs protobuf grpc++ grpc` -pthread -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed -ldl -o greeter_client
/usr/bin/ld: cannot find -lgrpc++
/usr/bin/ld: cannot find -lgrpc++_reflection
collect2: error: ld returned 1 exit status
Makefile:44: recipe for target 'greeter_client' failed
make: *** [greeter_client] Error 1
So, I searched these libs libgrpc++ in folder grpc/libs/opt, but there only these libraries
grpc/libs/opt$ ls --l
libaddress_sorting.a libgrpc_cronet.so.8
libaddress_sorting.so libgrpc_cronet.so.8.0.0
libaddress_sorting.so.8 libgrpc_plugin_support.a
libaddress_sorting.so.8.0.0 libgrpc.so
libares.a libgrpc.so.8
libboringssl.a libgrpc.so.8.0.0
libgpr.a libgrpc_unsecure.a
libgpr.so libgrpc_unsecure.so
libgpr.so.8 libgrpc_unsecure.so.8
libgpr.so.8.0.0 libgrpc_unsecure.so.8.0.0
libgrpc.a pkgconfig
libgrpc_cronet.a protobuf
libgrpc_cronet.so
So make didn't compile static and dynamic libraries for gRPC. Is it I did something wrong or didn't something or there is a bug? Version of protobuf is
:~$ protoc --version
libprotoc 3.8.0
:~$ which protoc
/usr/bin/protoc
Here is some output after I run "make" from root directory
[MAKE] Generating /home/user/cpp_test/grps/grpc/libs/opt/pkgconfig/grpc++.pc
[MAKE] Generating /home/user/cpp_test/grps/grpc/libs/opt/pkgconfig/grpc++_unsecure.pc
So it creates pkgconfig files for "libgrpc++*" libraries, but doesn't create these libraries.
And these having libgrpc++
libgrpc++ depbase=`echo google/protobuf/io/tokenizer.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
and
libgrpc++ depbase=`echo google/protobuf/util/delimited_message_util.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
only two lines
It looks like you only ran make from the third_party/protobuf directory (which you need to do as the first step), and ran make from the helloworld directory. If you did not do so already, you should run make from the grpc repository root directory, per the documentation. This will ensure the libgrpc++* C++ libraries are built.
So, I resolved this problem.
When I run "make" on root gRPC folder, compilation ended with such result:
[CXX] Compiling /home/user/cpp_test/grps/grpc/gens/src/proto/grpc/core/stats.pb.cc
/home/user/cpp_test/grps/grpc/gens/src/proto/grpc/core/stats.pb.cc:187:13: error: ‘dynamic_init_dummy_src_2fproto_2fgrpc_2fcore_2fstats_2eproto’ defined but not used [-Werror=unused-variable]
static bool dynamic_init_dummy_src_2fproto_2fgrpc_2fcore_2fstats_2eproto = []()
^
cc1plus: all warnings being treated as errors
Makefile:2924: recipe for target '/home/user/cpp_test/grps/grpc/objs/opt//home/user/cpp_test/august/grpc/gens/src/proto/grpc/core/stats.pb.o' failed
make: *** [/home/user/cpp_test/grps/grpc/objs/opt//home/user/cpp_test/august/grpc/gens/src/proto/grpc/core/stats.pb.o] Error 1
Because all warnings were treated as errors. And compiling of another libraries was stopped. So I manually added in Makefile in root gRPC directory flag -Wno-unused-variableat the end of 357 line. After adding this flag building of gRPC library went succesfully, and all libgrpc++* and libgrpc* libraries were built.
CPPFLAGS += -g -Wall -Wextra -Werror $(W_NO_UNKNOWN_WARNING_OPTION) -Wno-long-long -Wno-unused-parameter -Wno-deprecated-declarations -Wno-sign-conversion -Wno-shadow -Wno-conversion -Wno-implicit-fallthrough -Wno-sign-compare -Wno-missing-field-initializers -Wno-maybe-uninitialized -DPB_FIELD_32BIT -DOSATOMIC_USE_INLINED=1 -Ithird_party/nanopb -Ithird_party/upb -Isrc/core/ext/upb-generated -Wno-unused-variable
I am trying to compile a program mafTools on MacOSX using gnu make. I get the following error:
cd mafExtractor && make all
clang -std=c99 -stdlib=libstdc++ -O3 -c -O3 -Wall -Werror --pedantic -funroll-loops -DNDEBUG -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -I ../../sonLib/lib -I ../inc -I ../external src/mafExtractorAPI.c -o src/mafExtractorAPI.o.tmp -lm
This gives the error:
clang: error: -lm: 'linker' input unused [-Werror,-Wunused-command-line-argument]
make[1]: \*** [src/mafExtractorAPI.o] Error 1
make: \*** [mafExtractor.all] Error 2
I looked at similar errors but couldn't fix it. Any help will be much appreciated. Thanks!
This is the package: https://github.com/dentearl/mafTools/tree/master/mafExtractor
Everything else here compiled successfully.
This is the makefile:
https://github.com/dentearl/mafTools/blob/master/mafExtractor/Makefile
Thanks a bunch.
Your clang commaand includes the -c option which means you do not want to link and resolve external references, you just want to produce an unlinked object file.
Your -lm option says you want to link with the maths library.
Basically, the aforementioned options are incompatible - you cannot both link with the math library and not link.
TLDR; Remove -lm
in my project, i using both Scons and Makefile to build. It working good when i use Makefile ,but got error when i use Scons
"arm-none-eabi-gcc -g -mthumb -mlittle-endian -mcpu=cortex-m4
-mcpu=cortex-m4 -Wl,--start-group -lm -lc -Wl,--end-group -Wl,--gc-sections -Wl,-Map,main.map -Tstm32_flash.ld -Wl,--entry=Reset_Handler -DSTM32F407xx -DUSE_STDPERIPH_DRIVER -I/home/minhtan/Downloads/STM32F4-Discovery_FW_V1.1.0/Utilities/STM32F4-Discovery
-I/home/minhtan/Downloads/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/Include
-I/home/minhtan/Downloads/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/ST/STM32F4xx/Include
-I/home/minhtan/Downloads/STM32F4-Discovery_FW_V1.1.0/Libraries/STM32F4xx_StdPeriph_Driver/inc
"-I/home/minhtan/Downloads/led(make file moi)" main.c -c -o
main.o sh: 1: arm-none-eabi-gcc: not found scons:
[main.o] Error 127
scons: building terminated because of errors. "
This looks like the answer to #1 of our "most frequently asked" FAQs at http://scons.org/faq.html could help you out. By default, SCons doesn't import the variables like $PATH from the surrounding shell environment. You have to pull in your $PATH for properly detecting the arm-none-eabi-gcc executable or specify the full path to the executable explicitly...check the mentioned FAQ entry for a more detailed discussion about why things are as they are, and how to provide the required $PATH definitions to your build environments.
new update
I think I should edit the title now.
To make sure I got a clean environment, I
download qt5.1.1 src code from qt-prject.
export QNX_TARGET, QNX_HOST, AND add QNX_HOST into PATH.
then Run the script
./configure -opensource -confirm-license -xplatform qnx-armv7le-qcc -v
so in here, -opensource -confirm-license just avoid the Q&A -v is to show full message.
a lot of error message.
Creating qmake...
make: Nothing to be done for `first'.
Running configuration tests...
Determining architecture... ()
qcc -Vgcc_ntoarmv7le -c -Wno-psabi -lang-c++ -g -Wall -W -fPIE -DQT_NO_CLIPBOARD -I../../mkspecs/qnx-armv7le-qcc -I. -I/opt/qnx650/target/qnx6/usr/include -I/opt/qnx650/target/qnx6/usr/include/freetype2 -o arch.o arch.cpp
Unable to determine architecture!
Could not determine the target architecture!
Turn on verbose messaging (-v) to see the final report.
Determining architecture... ()
g++ -c -pipe -g -Wall -W -fPIE -I../../mkspecs/linux-g++ -I. -o arch.o arch.cpp
g++ -o arch arch.o { test -n "" && DESTDIR="" || DESTDIR=.; } && test $(gdb --version | sed -e 's,[^0-9]\+\([0-9]\)\.\([0-9]\).*,\1\2,;q') -gt 72 && gdb --nx --batch --quiet -ex 'set confirm off' -ex "save gdb-index $DESTDIR" -ex quit 'arch' && test -f arch.gdb-index && objcopy --add-section '.gdb_index=arch.gdb-index' --set-section-flags '.gdb_index=readonly' 'arch' 'arch' && rm -f arch.gdb-index || true
Found architecture in binary
CFG_HOST_ARCH="x86_64"
CFG_HOST_CPUFEATURES=" mmx sse sse2"
System architecture: 'unknown'
Host architecture: 'x86_64'
C++11 auto-detection... ()
qcc -Vgcc_ntoarmv7le -c -Wno-psabi -lang-c++ -O2 -Wc,-std=gnu++0x -Wall -W -fPIE-DQT_NO_CLIPBOARD -I../../../mkspecs/qnx-armv7le-qcc -I. -I/opt/qnx650/target/qnx6/usr/include -I/opt/qnx650/target/qnx6/usr/include/freetype2 -o c++11.o c++11.cpp
C++11 disabled.
floatmath auto-detection... ()
qcc -Vgcc_ntoarmv7le -c -Wno-psabi -lang-c++ -O2 -Wall -W -fPIE -DQT_NO_CLIPBOARD-I../../../mkspecs/qnx-armv7le-qcc -I. -I/opt/qnx650/target/qnx6/usr/include -I/opt/qnx650/target/qnx6/usr/include/freetype2 -o floatmath.o floatmath.cpp
qcc -Vgcc_ntoarmv7le -c -Wno-psabi -lang-c++ -O2 -Wall -W -fPIE -DQT_NO_CLIPBOARD -I../../../mkspecs/qnx-armv7le-qcc -I. -I/opt/qnx650/target/qnx6/usr/include -I/opt/qnx650/target/qnx6/usr/include/freetype2 -o freetype.o freetype.cpp
FreeType disabled.
STL auto-detection... ()
qcc -Vgcc_ntoarmv7le -c -Wno-psabi -lang-c++ -O2 -Wall -W -fPIE -DQT_NO_CLIPBOARD -I../../../mkspecs/qnx-armv7le-qcc -I. -I/opt/qnx650/target/qnx6/usr/include -I/opt/qnx650/target/qnx6/usr/include/freetype2 -o stltest.o stltest.cpp
STL disabled.
STL functionality check failed! Cannot build Qt with this STL library.
Turn on verbose messaging (-v) to /home/pasadeveloper/qt-everywhere-opensourcesrc-5.1.1/qtbase/configure to see the final report.
UPDATE:
I am working on QNX for ARM, target is an arm platform device.
Thing is getting weird. in Env Var, I put
$QNX_CONFIGURATION=/etc/qnx
$QNX_JAVAHOME=/opt/qnx650/_jvm
$QNX_TARGET=/opt/qnx650/target/qnx6
$QNX_HOST=/opt/qnx650/host/linux/x86
but when I do qmake qmake.conf mkspecs/qnx-armv7le-qcc folder
it returns an error message Project ERROR: QNX_TARGET environment variable not set
Have no clue what is going on now.
not just qmake qmake.conf
I try to build qt 5.1.2 at another host, ubuntu 12.04-64bit.
also get the same error message. Project ERROR: QNX_TARGET environment variable not set
I was working at Qt development under linux(FYI Ubuntu 12.04 -64bits), but I need to compile this program to binary for QNX.
I install QNX MOmentics IDE which provide QNX-gcc for me.
but I can't find the qmake-qnx.
Under the QT/gcc_64/mkspecs/qnx-armv7le-qcc, there is a file call qmake.conf. I guess this is where I can generate my qmake-qnx. after I run qmake -o Makefile qmake.conf, there is a Makefile generated.
However, when I run make, error occured.
qcc -Vgcc_ntoarmv7le -lang-c++ -Wl,-rpath-link,/opt/qnx650/target/qnx6/armle-v7/lib -Wl,-rpath-link,/opt/qnx650/target/qnx6/armle-v7/usr/lib -Wl,-O1 -Wl,-O1 -Wl,-rpath,/home/pasadeveloper/Qt5.1.0/5.1.0/gcc_64 -Wl,-rpath,/home/pasadeveloper/Qt5.1.0/5.1.0/gcc_64/lib -o qmake -L/opt/qnx650/target/qnx6/armle-v7/lib -L/opt/qnx650/target/qnx6/armle-v7/usr/lib -lm -L/home/pasadeveloper/Qt5.1.0//5.1.0/gcc_64/lib -lQt5Gui -lQt5Core -lGL -lpthread
cc: no files to process
make: *** [qmake] Error 1
pasadeveloper#ubuntu:~/Qt5.1.0/5.1.0/gcc_64/mkspecs/qnx-armv7le-qcc$
You do not "generate" your qmake-qnx like that. You are supposed to use the native qmake for generating proper makefiles for your target to aid the cross-compilation. Also, running qmake qmake.conf in the relevant mkspecs folder is wrong because that is not a project file as you may think.
When building Qt itself for instance, you should be using the proper mkspecs files for the target in which case, it is the one you also mentioned above if it is built for that particular arm qnx variant, called qnx-armv7le-qcc.
Here is the exact command you need to run after downloading the relevant Qt sources, like 5.1.1:
./configure -opensource -confirm-license -xplatform qnx-armv7le-qcc -v
For this QNX version, the bottom line is, if you do not have SP1 and libscreen, it will not work. The QPA plugin would link against it. This library provides the API to the graphics server on newer QNX variants. You need to talk to your QNX representatives.
Here you can find further information about the topic.
$QNX_TARGET=/opt/qnx650/target/qnx6
is probably not doing what you want. In shell scripts, you don't put a "$" in front of a variable when you are defining the variable, only when you access the variable:
X=hello
echo $X