Compile error when I install HAWQ on Centos7: - c

I want to install HAWQ on my Centos7.5
When I run: ./configure and make -j8
I got this one:
g++ --shared -o cwrapper.o cwrapper.cpp -Lformat -lorc_format
/usr/bin/ld: /tmp/ccjv719I.o: relocation R_X86_64_PC32 against symbol `_Z9func_testv' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
If I run make install next
I can't get all files in hawq
but When I retry ./configure,make -j8,make install
ccjv719I.o will change ,maybe cc4U41Di.o or others
When I run :./configure CFLAGES=-fPIC CXXFLAGES=-fPIC --enable-shared
I got the same error.
What should I do?

Try:
./configure --prefix=/hawq/install/path --with-python --with-perl

Related

gcc compile error: /usr/bin/ld: gfx.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE

Error is as follows:
/usr/bin/ld: gfx.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
make: *** [Makefile:4: project] Error 1
and when I add -fPIC or -fPIE, nothing changes. I know that the gfx.o library works, since it was working previously and still works when I ssh on my server.
Make file is as follows:
project: project.c
gcc project.c gfx.o -lx11 -lm -fPIE -o -project
clean:
rm project
I tried to use -fPIE and -fPIC in the makefile. I also treid uninstalling and reinstalling gcc and binutills, but nothing worked.
I figured out that putting -no-pie in the Makefile solves the issue. I don't know if there is a more permanent and widespread fix, but it works.

libmodbus: how to compile application including libmodbus library?

I have a problem with compilation of my application, which is based on libmodbus library:
https://github.com/stephane/libmodbus
I have tried to compile it using this command:
cc pkg-config --cflags --libs libmodbus modbus.c -o modbus
But I get the following errors:
/usr/bin/ld: /tmp/cckdtbWy.o: in function `main':
modbus.c:(.text+0x1b): undefined reference to `modbus_new_tcp_pi'
/usr/bin/ld: modbus.c:(.text+0x5c): undefined reference to `modbus_connect'
/usr/bin/ld: modbus.c:(.text+0x8d): undefined reference to `modbus_free'
/usr/bin/ld: modbus.c:(.text+0xa3): undefined reference to `modbus_connect'
/usr/bin/ld: modbus.c:(.text+0xde): undefined reference to `modbus_read_bits'
/usr/bin/ld: modbus.c:(.text+0x11e): undefined reference to `modbus_close'
/usr/bin/ld: modbus.c:(.text+0x12a): undefined reference to `modbus_free'
collect2: error: ld returned 1 exit status
I would appreciate any help!
Best regards!
I have worked through this problem and my solution is that:
1. Create modbus.conf file in /etc/ld.so.conf.d/.
2. Run sudo ldconfig.
3. Compile your application/program with the following command:
gcc <name>.c -o <name> -I/usr/local/include/modbus/ -lmodbus
It has worked for me, but I am not sure whether the first step is necessary.
Did you install the libmodbus-dev? You should try this: sudo apt-get install -y libmodbus-dev.
See v3.1.6 and v3.0.8: libmodbus docs

DLL file format not recognized

So I've been trying to install the luasql-mysql module for a while now and I keep running into problems. This time when I go to install it gives me this error:
luasql-mysql 2.5.0-1 depends on lua >= 5.1 (5.3-1 provided by VM)
mingw32-gcc -O2 -c -o src/luasql.o -IC:\Program Files\lua-5.3.5\src src/luasql.c -
Ic:/windows/system32/include
mingw32-gcc -O2 -c -o src/ls_mysql.o -IC:\Program Files\lua-5.3.5\src src/ls_mysql.c -
Ic:/windows/system32/include
mingw32-gcc -shared -o luasql/mysql.dll src/luasql.o src/ls_mysql.o -Lc:/windows/system32 -
lmysqlclient C:\Program Files\lua-5.3.5\src/lua53.dll -lm
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot find -lmysqlclient
C:\Program Files\lua-5.3.5\src\lua53.dll: file not recognized: file format not recognized
collect2.exe: error: ld returned 1 exit status
Error: Build error: Failed compiling module luasql/mysql.dll
I'm going to try reinstalling everything and hopefully that works but if anyone knows why I'm getting this problem then I would appreciate the help.

Compile FFTW with pgcc, undefined reference

For other software I need fftw-2.1.5 with --enable-mpi --enable-type-prefix --enable-float installed. It should be compiled with pgcc
PGCC, etc. are installed under the /home directory. For this post I have shortend it with path-to.
I do:
./configure --prefix=/path-to/fftw --enable-mpi --enable-type-prefix --enable-float CC=path-to/pgcc CXX=path-to/pgc++ F77=path-to/pgf77 FC=path-to/pgfortran
make`
./configure finishes successful, during make I get this error message:
/usr/bin/ld: ../fftw/.libs/libsfftw.a(malloc.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: ../fftw/.libs/libsfftw.a(putils.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: ../fftw/.libs/libsfftw.a(twiddle.o): relocation R_X86_64_32 against .data' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
I tried to recompile with the -fPIC flag:
make clean
make CFLAGS="-fPIC"
Then I get:
../fftw/.libs/libsfftw.a(twiddle.o): In function `fftw_compute_twiddle':
/home/daniel/fftw-test/fftw-2.1.5/fftw/./twiddle.c:92: undefined reference to `__fd_sincos_1'
/home/daniel/fftw-test/fftw-2.1.5/fftw/./twiddle.c:126: undefined reference to `__fd_sincos_1'
../fftw/.libs/libsfftw.a(twiddle.o): In function `fftw_compute_rader_twiddle':
/home/daniel/fftw-test/fftw-2.1.5/fftw/./twiddle.c:65: undefined reference to `__fd_sincos_1'
collect2: error: ld returned 1 exit status
I've now tried to find a solution to why this happens for hours but I cannot figure it out.
When I configure it to use the gcc compiler (system default) everything works perfectly:
./configure --prefix=/fftw --enable-mpi --enable-type-prefix --enable-float
make
make install
EDIT, more information:
The program for which I need fftw, needs pgcc. I though it would be best if I compile everything with it as it was recommended on some forum sites.
In twiddle.c there is not a single mention of __fd_sincos_1. For example line 92 is simply
for (i = 0; i < n; ++i) {
When I drop the --enable-type-prefix nothing changes. Still the same error.

How to solve the linking error in libwebsockets

I use libwebsockets for a client program in C. Therefore I build the library for the libwebsocktes locally on my machine (ubuntu). After I want to Build the Project in Eclipse, I get the following output:
14:58:40 **** Incremental Build of configuration Build (GNU) for project ClientA ****
make all
cc -o clientA ifaddrs.o mo.o misc.o dm.o ws.o -lcurl -lrt -lxml2 -ljson-c -lssl -lcrypto -lpthread -Wl,-Bstatic -L/home/vps/src/libwebsockets/build/lib -lwebsockets -Wl,-Bdynamic
/usr/bin/ld: /home/bla/libwebsockets/build/lib/libwebsockets.a(ssl.c.o): undefined reference to symbol 'SSL_get_fd##OPENSSL_1.0.0'
/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libssl.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [clientA] Error 1
14:58:41 Build Finished (took 1s.223ms)
It seems to be a problem with the libwebsockets.a. But how I can solve it ?

Resources