Repast HPC in Xcode 5.1 parse issue error - c++

all.
I’d like to ask a question about the error I encounter when I try to use Repast HPC in Xcode 5.1.
(Repast HPC is an agent-based simulation library based on C++. For more information, go to http://repast.sourceforge.net/repast_hpc.html)
For testing, I tried to build and run the Repast HPC Tutorial Demo code from tutorial page(http://repast.sourceforge.net/hpc_tutorial/RepastHPC_Demo_00_Step_05.html).
I succeeded to run Demo00 Step 04, which seems to mean that my preference setting is correct, but failed to run Demo00 Step 05. The major difference between those two is “RepastProcess.h” is included in Step 05.
The error occurs in 50th line of “logger.h” file, which is included "RepastProcess.h". The line of error is,
typedef enum _LogLevel {DEBUG, INFO, WARN, ERROR, FATAL} LOG_LEVEL;
The error is 'parse issue error' and the message says "Expected '}'" and the location of error seems to be 'DEBUG' because there is a tiny triangle under the word.
I googled a lot, but I couldn’t find any issue in the code.
Does anybody face similar error? Is it the problem of Xcode setting?
Many thanks in advance.

Related

Build issue when running `make -j` - 'je_malloc' attribute directive ignored

Building rocksdb on my Ubuntu 20.04 box. I get the following error:
In file included from db/malloc_stats.cc:16:
./port/jemalloc_helper.h:63:29: error: 'je_malloc' attribute directive ignored [-Werror=attributes]
63 | __attribute__((__weak__));
| ^
I'm compiling using a simple make -j and I have all the listed dependencies installed, including libjemalloc-dev, but I've tried uninstalling it to no avail. gcc version is 9.3.0. Reinstalling it as well. These attribute directives are an area of C++ I'm not at all familiar with and I have no idea how to diagnose this problem. If I pass DISABLE_WARNING_AS_ERROR, I end up with linker errors, so clearly this error is meaningful. Notably, I was able to build this quite recently on this machine, and I don't recall changing anything that would have affected this. I did system updates, but nothing else that would possibly cause this that I know of. I've checked previous commits of rocksdb and I get the same error so the problem is definitely on my end somehow, but I've checked with coworkers and none of them have this problem. Any ideas or advice on how to diagnose this issue would be appreciated.
EDIT: I've just tried running make alone, and while it took forever, the build succeeded. This is not practical and I'm still at a complete loss as to how to diagnose this issue.
EDIT 2: The successful build with make is not consistent, though I am confident that it succeeded at least once. When it doesn't succeed I get the same error as above.

Upgrading gcc to 8/9 trigger "Error: unsupported instruction `vmovdqu'" while gcc-7 runs fine

I compile Apache Arrow (https://arrow.apache.org/) with CMake 3.15 and gcc/g++-7 (7.5.0) and it goes well. However, when I upgrade gcc/g++ to 8(8.4.0) and 9(9.3.0) with the same CMake version, I got the following errors:
/tmp/ccrlCxYO.s: Assembler messages:
/tmp/ccrlCxYO.s:5651: Error: unsupported instruction `vmovdqu'
make[2]: *** [src/parquet/CMakeFiles/parquet_objlib.dir/build.make:194: src/parquet/CMakeFiles/parquet_objlib.dir/encoding.cc.o] Error 1
The target file (encoding.cc) is a pure C++ file. It uses Intel Intrinsics, but does not contain any assembly code.
This is the first time I see an "Assembler message" error. So I request some help understanding what it means. My question:
When would the assembler complain about unsupported instruction? I have seen unsupported instruction at runtime before, but not this "Assembler message". As this happens after upgrading GCC, I guess this is a new feature of the new compiler/assembler? I cannot find any document, so if anyone can point to me any doc explaining this it would be very appreciated.
Adding "-mavx" to target_compile_options does not solve the problem. Anyone has a suggestion of solution to the problem?
Thank you!
TLDR: I found the solution is to add "-mavx512bw" to target_compile_options
Please continue reading if you want to hear more detail about the root cause, and how I found it.
After googling a bit I found this webpage talking about a bug of GNU AS. https://www.mail-archive.com/bug-binutils#gnu.org/msg30524.html
That webpage reports that AS does not recognize "vmovdqu16", which needs the support of AVX512VL+AVX512BW. However, the assembler reports an error message saying "vmovdqu" is not supported.
This reminds me that I may encounter the same issue. The AS actually receives "vmovdqu8/16/32" but it reports "vmovdqu". This error message is very misleading because "vmovdqu" and "vmovdqu16" need different instruction set supports. The former only need AVX, but the latter need AVX512BW+AVX512VL.
I decided to give it a try and add -mavx512bw to the compile option ( I already have avx512vl before). It actually fixes the problem.
So I think the whole story is: the newer version of GCC uses some new SIMD instruction, which the old GCC did not use.
Hope this helps someone who also run into similar problems.

Simulation terminated with exit code: 132

I am Mac OS 10.11 (El Capitan) user. I used 4.6 and when I tried to build some simulation I always get "Simulation terminated with exit code: 139" and couldn’t do nothing at all with that. I thought that when I install 5.0 then everything will be fine, but now I get something like that:
Simulation terminated with exit code: 132
Working directory: /Users/JL_Data/omnetpp-5.0/samples/tictoc
Command line: tictoc -r 0 --debug-on-errors=false omnetpp.ini
Environment variables:
PATH=/Users/JL_Data/omnetpp-5.0/bin::/usr/bin:/bin:/usr/sbin:/sbin
DYLD_LIBRARY_PATH=/Users/JL_Data/omnetpp-5.0/lib::
OMNETPP_IMAGE_PATH=/Users/JL_Data/omnetpp-5.0/images
And when I tried open some simulation in terminal I get:
Illegal instruction: 4
Do you have some idea what can I do with that problem? I tried to find something on the internet, but after one day I do not get any idea.
If you need some more information, please let me know.
As it is right now, your question is not completely clear, since it requires one to be familiar with omnet++ and probably some experience installing and setting it up. However, let me make a couple guesses.
First, Illegal instruction. This usually occurs when the binary was built for an architecture different than the one it's being run on; e.g. when then SSE2 or AVX instructions are present in the binary code, but are missing on the CPU.
See, for example, this SO question:
Find which assembly instruction caused an Illegal Instruction error without debugging
There is also a question that discusses exactly your problem, namely, "Illegal instruction: 4" on OS X:
What is the "Illegal Instruction: 4" error and why does "-mmacosx-version-min=10.x" fix it?
Now, since omnet++ appears to be an open source project, I expect it to have a mailing list and / or an IRC channel. Indeed, here is the communications page on the official website that links to a Google Groups-based mailing list:
https://omnetpp.org/get-involved
https://groups.google.com/forum/#!forum/omnetpp
I advise you to get in touch with the developers with a thorough description of your problem, since the chances of them knowing the solution are significantly higher compared to the chances of there being a user on SO who has faced similar problems when installing an identical version of omnet++ on an identical version of Mac OS X.

how to get started with PCM?

I wanted to work on Intel PCM. I follwed the below link:
https://software.intel.com/en-us/articles/intel-performance-counter-monitor
I downloaded the code, i started to study example pcm.cpp. But Im not getting any proper understanding. Documentation is not that much clear.
http://intel-pcm-api-documentation.github.io/classPCM.html
I tried to run , pcm.x ,it gave basic information then showed some error like:
"Trying to use Linux perf events...
Linux Perf: Error on programming generic event #0 error: Invalid argument
Access to Intel(r) Performance Counter Monitor has denied (Unknown error)."
Unknown error! I cant figure out why its not accessible. I used with sudo also(root privileges).
Any suggestions how I can start working with it? Where to start?
Found a workaround here by Roman Dementiev that worked for me:
As a workaround you can disable perf usage in the PCM Makefile by removing "-DPCM_USE_PERF".

"Compile Server Error." while building OpenCL kernels

I am trying to compile OpenCL kernels on OS X. Everything is ok when there are just a few lines. However, after the code grows over 1.5k lines, clGetProgramBuildInfo with CL_PROGRAM_BUILD_LOG flag returned "Compile Server Error." every time. I googled but found nothing about it. Could anyone help me?
You can learn the meaning of OpenCL error codes by searching in cl.h. In this case, -11 is just what you'd expect, CL_BUILD_PROGRAM_FAILURE. It's certainly curious that the build log is empty. Two questions:
1.) What is the return value from clGetProgramBuildInfo?
2.) What platform are you on? If you are using Apple's OpenCL implementation, you could try setting CL_LOG_ERRORS=stdout in your environment. For example, from Terminal:
$ CL_LOG_ERRORS=stdout ./myprog
It's also pretty easy to set this in Xcode (Edit Scheme -> Arguments -> Environment Variables).
Please find the original answer by #James
This unhelpful error message indicates that there is bug in Apple's compiler. You can inform them of such bugs by using the Apple Bug Reporting System.