error while running makefile for opencl program - makefile

I have just started learning OpenCL. I received the following error when I typed in make to compile the HelloCL program:
mkdir -p depends/x86_64
perl ../../../../../make/fastdep.pl -I. -I../../../../../include -I../../../../../samples/opencl/SDKUtil/include --obj-suffix='.o' --obj-prefix='build/debug/x86_64//' HelloCL.cpp > depends/x86_64/HelloCL.depend
mkdir -p build/debug/x86_64/
Building build/debug/x86_64//HelloCL.o
g++ -Wpointer-arith -Wfloat-equal -g3 -ffor-scope -I ../../../../../samples/opencl/SDKUtil/include -I "/opt/AMDAPP/include" -I ../../../../../include -o build/debug/x86_64//HelloCL.o -c HelloCL.cpp
In file included from HelloCL.cpp:106:0:
/opt/AMDAPP/include/CL/cl.hpp: In function ‘cl_int cl::UnloadCompiler()’:
/opt/AMDAPP/include/CL/cl.hpp:1826:12: error: ‘::clUnloadCompiler’ has not been declared
/opt/AMDAPP/include/CL/cl.hpp: In member function ‘cl_int cl::CommandQueue::enqueueMarker(cl::Event*) const’:
/opt/AMDAPP/include/CL/cl.hpp:4842:13: error: ‘::clEnqueueMarker’ has not been declared
/opt/AMDAPP/include/CL/cl.hpp: In member function ‘cl_int cl::CommandQueue::enqueueWaitForEvents(const std::vector<cl::Event>&) const’:
/opt/AMDAPP/include/CL/cl.hpp:4849:13: error: ‘::clEnqueueWaitForEvents’ has not been declared
/opt/AMDAPP/include/CL/cl.hpp: In member function ‘cl_int cl::CommandQueue::enqueueBarrier() const’:
/opt/AMDAPP/include/CL/cl.hpp:4985:13: error: ‘::clEnqueueBarrier’ has not been declared
make: *** [build/debug/x86_64//HelloCL.o] Error 1
Can someone help me understand the errors I am seeing, and suggest the corrections that need to be made?

Looks like cl.hpp you use is not adopted for the version of OpenCL your SDK supports. Try the cl.hpp from the Khronos site.

I advise downloading latest AMD APP SDK from : http://developer.amd.com/sdks/AMDAPPSDK/downloads/Pages/default.aspx
And try running the samples again, this SDK supports: OpenCL 1.2, so you shouldn't see any issues.

Related

gcc compiling errors using macOS BigSur M1 chip

I recently switched from Windows to mac and bravely took the new MacBook with macOS BigSur and M1 chip. I'm trying to install BPP (https://github.com/bpp/bpp) following the program's installation guide, but run into problems when trying to compile an executable file.
git clone https://github.com/bpp/bpp.git
cd bpp/src
make
This gave multiple errors like this:
cc -D_GNU_SOURCE -DHAVE_SSE3 -DHAVE_AVX -DHAVE_AVX2 -g -msse3 -O3 -Wall -Wsign-compare -c -o bpp.o bpp.c
clang: warning: argument unused during compilation: '-msse3' [-Wunused-command-line-argument]
In file included from bpp.c:22:
In file included from ./bpp.h:43:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/x86intrin.h:15:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/immintrin.h:14:
Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/mmintrin.h:373:12: error:
invalid conversion between vector type '__m64' (vector of 1 'long long'
value) and integer type 'int' of different size
return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So I thought maybe the problem is that the default compiler is Clang 12 and after installing gcc-11 (which should be appropriate for M1) run:
make CC=/opt/homebrew/bin/gcc-11
But it gave an error too:
gcc-11: error: unrecognized command-line option '-msse3'
make: *** [bpp.o] Error 1
Since I'm not an experienced coder and with M1 being so new that finding solutions from forums is not simple, I'm kind of in a dead end. Any suggestions how to work through this problem?
I guess it is due to the fact that SSE3 is an x86 feature?

How to specify and use a locally installed package in a makefile?

I'm trying make a program which requires Armadillo as a dependency. I've installed Armadillo in a local directory (I'm working on a cluster without root privileges), but am unable to install the program because it can't find armadillo. How would I specify that? Thanks in advance for the help!
What I'm doing & seeing:
$ make
g++ -O3 -o ancestry_hmm ancestry_hmm.cpp -larmadillo
ancestry_hmm.cpp:22:21: fatal error: armadillo: No such file or directory
#include <armadillo>
^
compilation terminated.
make: *** [all] Error 1
The current Make file:
TCFLAGS = -ltcmalloc
ARMAFLAGS = -larmadillo
all:
$(LINK.cc) -O3 -o ancestry_hmm ancestry_hmm.cpp $(ARMAFLAGS)
Path to armadillo:
/{user}/Programs/Anaconda/*.so
/{user}/Programs/Anaconda/
Answer was provided by Claes Rolen in the comments. I had to also add -lgfortran, but it works, thanks!

Makefile: fatal error: NE10.h: No such file or directory

Currently trying to Makefile and encountered this error:
fatal error: NE10.h: No such file or directory
#include "NE10.h"
^~~~~~~~
compilation terminated
Am looking for the cause of this (is it related to the root directory?) and possible resolution of such an error?
Currently on a NVIDIA Xavier Arm Processor.
And
command -v g++
/usr/bin/g++
g++ --version
g++ (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0
Resolved this by doing an install of the NE10 package, then including in cmake/make process.
https://projectne10.github.io/Ne10/
Was missing the package on the whole, for anyone looking for this answer. Thanks!

wxFreeChart and -mthreads

I’m trying to develop some plotting apps for Windows platform. I’m using Debian and built wxWidgets for cross-compiling as described here.
With MinGW compiler it works perfect and I have no problem with creating Win32 apps under Linux. But I faced some troubles with wxFreeChart.
I run ./configure --host=i386-mingw32 --with-wx-config=/usr/local/i586-mingw32/bin/wx-config
Then I run 'make' and getting error about
unrecognized command line option ‘-mthreads
Full output here:
~/dev/freechart/bk-deps g++ -c -o wxfreechart_lib_legend.o -I./include -I/usr/local/i586-mingw32/lib/wx/include/i586-mingw32msvc-msw-unicode-static-3.0 -I/usr/local/i586-mingw32/include/wx-3.0 -D_LARGEFILE_SOURCE=unknown -D__WXMSW__ -mthreads -O2 ./src/legend.cpp
g++: error: unrecognized command line option ‘-mthreads’
make: *** [wxfreechart_lib_legend.o] Error 1
The only advice I've seen was to remove '-mthreads' from code, but I have no idea where is it(
Problem described above is solved, but still no luck with building wxFreeChart.
Next errors I get were about some additional libs, which I finally solved by
CPPFLAGS="-I/usr/i586-mingw32msvc/include -I~/dev/wxWidgets-3.0.2/include" ./configure --host=i386-mingw32 --with-wx-config=/usr/local/i586-mingw32/bin/wx-config
I'm not sure that including .h from source folder ~/dev/wxWidgets is a good idea, but at least it solved some problems.
Now make crashing with messages like:
In file included from /usr/local/i586-mingw32/include/wx-3.0/wx/wx.h:17:0,
from ./include/wx/wxfreechartdefs.h:20,
from ./include/wx/legend.h:13,
from ./src/legend.cpp:10:
/usr/local/i586-mingw32/include/wx-3.0/wx/list.h: In constructor ‘wxListKey::wxListKey(const wxString&)’:
/usr/local/i586-mingw32/include/wx-3.0/wx/list.h:381:40: error: invalid use of incomplete type ‘class wxString’
or
/usr/local/i586-mingw32/include/wx-3.0/wx/containr.h:247:13: error: incomplete type ‘wxNavigationEnabled<wxControl>::BaseWindowClass {aka wxControl}’ used in nested name specifier
make: *** [wxfreechart_lib_legend.o] Error 1

Importing an AIX kernel extension file using GCC

I'm building a sample program using kernel extension on AIX 6.1.
Actually, I made a extension file, but I don't know how to import it.
Usually people using IBM C compiler can import this with "-bI:test.esp".
When I used this option for test program. I got the following error.
bash# gcc -o test_prog -bI:import test_prog.c
test_prog.c: In function 'main':
gcc: unrecognized option '-bI:question.esp'
ld: 0711-317 error: unrecognized symbol: .question
collect2: ld returned 8 exit status
That's a linker option so to tell GCC to forward it to the linker use -Wl,-bI:question.esp or -Xlinker -bI:question.esp

Resources