Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

openmodelica-devel macports build broken on OS X 10.6?

openmodelica-devel macports build broken on OS X 10.6?

I've been trying to get OpenModelica running on my machine running 10.6.8 with no luck. I followed the instructions given here to build from sources using macports, but it seems to fail with error code 2. I then just cd'd over to the macports workspace and started trying to diagnose the issue. The first thing I noticed was that gcc/g++ was complaining about an unrecognised option:

Code:

gcc-mp-4.4: unrecognized option '-Xarch_x86_64'

I think this is a typo and should have a space rather than an underscore between Xarch and x86_64. Several Makefiles seemed to have this problem (OMShellGUI, OMEditGUI, OMPlotGUI). After fixing the individual Makefiles, compilation broke again for SimulationRuntime/ParModelica/OpenCLRuntime/CL/cl.h . This time it appears as though the error is from the parser, shown below:

Code:


make -C SimulationRuntime/ParModelica/OpenCLRuntime -f Makefile
/opt/local/bin/g++-mp-4.4  -I/opt/local/include -I. -I"../../c"  -c -o omc_ocl_memory_ops.o omc_ocl_memory_ops.cpp
In file included from ./omc_ocl_common_header.h:47,
                 from ./omc_ocl_memory_ops.h:48,
                 from omc_ocl_memory_ops.cpp:47:
./CL/cl.h:479: error: expected ')' before '*' token
./CL/cl.h:479: error: expected ')' before '*' token
./CL/cl.h:479: error: expected initializer before '*' token
./CL/cl.h:486: error: expected ')' before '*' token
./CL/cl.h:486: error: expected ')' before '*' token
./CL/cl.h:486: error: expected initializer before '*' token
./CL/cl.h:554: error: expected initializer before 'CL_API_SUFFIX__VERSION_1_1'
./CL/cl.h:608: error: expected ')' before '*' token
./CL/cl.h:608: error: expected ')' before '*' token
./CL/cl.h:608: error: expected initializer before '*' token
./CL/cl.h:660: error: expected ')' before '*' token
./CL/cl.h:660: error: expected ')' before '*' token
./CL/cl.h:660: error: expected initializer before '*' token
./CL/cl.h:734: error: expected initializer before 'CL_API_SUFFIX__VERSION_1_1'
./CL/cl.h:744: error: expected initializer before 'CL_API_SUFFIX__VERSION_1_1'
./CL/cl.h:749: error: expected ')' before '*' token
./CL/cl.h:749: error: expected ')' before '*' token
./CL/cl.h:749: error: expected initializer before '*' token
./CL/cl.h:793: error: expected initializer before 'CL_API_SUFFIX__VERSION_1_1'
./CL/cl.h:820: error: expected initializer before 'CL_API_SUFFIX__VERSION_1_1'
./CL/cl.h:846: error: expected initializer before 'CL_API_SUFFIX__VERSION_1_1'
make[1]: *** [omc_ocl_memory_ops.o] Error 1
make: *** [opencl_rt] Error 2

I'd appreciate any help that anyone could offer in tracking down this issue.

Oh and it appears that the binaries for Mac also linked on the "Download Mac" page doesn't work on my computer, failing with the following error when /opt/openmodelica/bin/omc is executed:

Code:


terminate called after throwing an instance of '__gnu_cxx::__concurrence_lock_error'
  what():  __gnu_cxx::__concurrence_lock_error
Abort trap

Re: openmodelica-devel macports build broken on OS X 10.6?

Which of the options did you use? The OpenModelica sources do not use Xarch anywhere so it comes from either the portfile or the macports settings. From what I can tell the nightly is now done using +clang since OSX no longer likes GCC.

Re: openmodelica-devel macports build broken on OS X 10.6?

Well the instructions for building on Mac said that I should set configure.compiler=macports-gcc-4.4 or set +gcc44, however I see that it's been recently (past 24 hrs?) updated. I executed port clean openmodelica-devel and repeated the installation with port install openmodelica-devel +clang. Make still bombs out in cl.h:

Code:


/opt/local/bin/clang++-mp-3.1  -I/opt/local/include -I. -I"../../c"  -c -o omc_ocl_builtin_kernels.o omc_ocl_builtin_kernels.cpp
In file included from omc_ocl_memory_ops.cpp:47:
In file included from ./omc_ocl_memory_ops.h:48:
In file included from ./omc_ocl_common_header.h:47:
./CL/cl.h:479:35: In file included from error: omc_ocl_interface.cppexpected ')'
:52:
In file included from ./omc_ocl_interface.h:55:
In file included from ./omc_ocl_common_header.h:47:
./CL/cl.h:479:35: error: expected ')'
                void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *),
                                  ^
./CL/cl.h:479:22: note: to match this '('
                void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *),
                     ^
./CL/cl.h:486:43: error: expected ')'
                void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *),
                                  ^
                        void (CL_CALLBACK *     /* pfn_notify*/ )(const char *, const void *, size_t, void *),
                                          ^
./CL/cl.h./CL/cl.h:486:30: note: to match this '('
:479:22: note: to match this '('
                        void (CL_CALLBACK *     /* pfn_notify*/ )(const char *, const void *, size_t, void *),
                             ^
                void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *),
                     ^
./CL/cl.h:486:43: error: expected ')'
                        void (CL_CALLBACK *     /* pfn_notify*/ )(const char *, const void *, size_t, void *),
                                          ^
./CL/cl.h:486:30: note: to match this '('
                        void (CL_CALLBACK *     /* pfn_notify*/ )(const char *, const void *, size_t, void *),
                             ^
./CL/cl.h:554:63: error: expected function body after function declarator
                  cl_int *                 /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
                                                              ^
./CL/cl.h:554:63: error: expected function body after function declarator
                  cl_int *                 /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
                                                              ^
./CL/cl.h:608:55: error: expected ')'
                                    void (CL_CALLBACK * /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
                                                      ^
./CL/cl.h:608:42:./CL/cl.h:608:55: error: expected ')'
                                    void (CL_CALLBACK * /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
                                                      ^
./CL/cl.h:608:42: note: to match this '('
                                    void (CL_CALLBACK * /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
                                         ^
./CL/cl.h:609:73: error: expected function body after function declarator
note: to match this '('
                                    void * /*user_data */ )             CL_API_SUFFIX__VERSION_1_1; 
                                                                        ^
                                    void (CL_CALLBACK * /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
                                         ^
./CL/cl.h:660:34: error: expected ')'
               void (CL_CALLBACK *  /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
                                 ^./CL/cl.h:609:73: error: expected function body after function declarator
                                    void * /*user_data */ )             CL_API_SUFFIX__VERSION_1_1; 
                                                                        ^

./CL/cl.h:660:21: note: to match this '('
               void (CL_CALLBACK *  /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
                    ^
./CL/cl.h:734:52: error: expected function body after function declarator
                  cl_int *      /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;               
                                                   ^
./CL/cl.h:744:57: error: expected function body after function declarator
                     cl_int     /* execution_status */) CL_API_SUFFIX__VERSION_1_1;
                                                        ^
./CL/cl.h:749:39: error: expected ')'
                    void (CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *),
                                      ^
./CL/cl.h:749:26: note: to match this '('
                    void (CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *),
                         ^
./CL/cl.h:750:50: error: expected function body after function declarator
                    void *      /* user_data */) CL_API_SUFFIX__VERSION_1_1;
                                                 ^
./CL/cl.h:793:58: error: expected function body after function declarator
                        cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_1;
                                                         ^
./CL/cl.h:820:59: error: expected function body after function declarator
                         cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_1;
                                                          ^
./CL/cl.h:846:58: error: expected function body after function declarator
                        cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_1;
                                                         ^
./CL/cl.h:660:34: error: expected ')'
               void (CL_CALLBACK *  /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
                                 ^
./CL/cl.h:660:21: note: to match this '('
               void (CL_CALLBACK *  /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
                    ^
./CL/cl.h:734:52: error: expected function body after function declarator
                  cl_int *      /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;               
                                                   ^
./CL/cl.h:744:57: error: expected function body after function declarator
                     cl_int     /* execution_status */) CL_API_SUFFIX__VERSION_1_1;
                                                        ^
./CL/cl.h:749:39: error: expected ')'
                    void (CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *),
                                      ^
./CL/cl.h:749:26: note: to match this '('
                    void (CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *),
                         ^
./CL/cl.h:750:50: error: expected function body after function declarator
                    void *      /* user_data */) CL_API_SUFFIX__VERSION_1_1;
                                                 ^
./CL/cl.h:793:58: error: expected function body after function declarator
                        cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_1;
                                                         ^
./CL/cl.h:820:59: error: expected function body after function declarator
                         cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_1;
                                                          ^
./CL/cl.h:846:58: error: expected function body after function declarator
                        cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_1;
                                                         ^
13 errors generated.
13 errors generated.
make[1]: *** [omc_ocl_memory_ops.o] Error 1
make[1]: *** Waiting for unfinished jobs....
/usr/bin/make -C testsuite/difftool
make[1]: *** [omc_ocl_interface.o] Error 1
cp -pP 3rdParty/gc-7.2/include/gc.h build/include/omc/gc.h
make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_14576/testsuite/difftool'
flex omc-diff.l
In file included from omc_ocl_builtin_kernels.cpp:53:
In file included from ./omc_ocl_builtin_kernels.h:60:
In file included from ./omc_ocl_memory_ops.h:48:
In file included from ./omc_ocl_common_header.h:47:
./CL/cl.h:479:35: error: expected ')'
                void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *),
                                  ^
./CL/cl.h:479:22: note: to match this '('
                void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *),
                     ^
./CL/cl.h:486:43: error: expected ')'
                        void (CL_CALLBACK *     /* pfn_notify*/ )(const char *, const void *, size_t, void *),
                                          ^
./CL/cl.h:486:30: note: to match this '('
                        void (CL_CALLBACK *     /* pfn_notify*/ )(const char *, const void *, size_t, void *),
                             ^
./CL/cl.h:554:63: error: expected function body after function declarator
                  cl_int *                 /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
                                                              ^
./CL/cl.h:608:55: error: expected ')'
                                    void (CL_CALLBACK * /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
                                                      ^
./CL/cl.h:608:42: note: to match this '('
                                    void (CL_CALLBACK * /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
                                         ^
./CL/cl.h:609:73: error: expected function body after function declarator
                                    void * /*user_data */ )             CL_API_SUFFIX__VERSION_1_1; 
                                                                        ^
./CL/cl.h:660:34: error: expected ')'
               void (CL_CALLBACK *  /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
                                 ^
./CL/cl.h:660:21: note: to match this '('
               void (CL_CALLBACK *  /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
                    ^
./CL/cl.h:734:52: error: expected function body after function declarator
                  cl_int *      /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;               
                                                   ^
./CL/cl.h:744:57: error: expected function body after function declarator
                     cl_int     /* execution_status */) CL_API_SUFFIX__VERSION_1_1;
                                                        ^
./CL/cl.h:749:39: error: expected ')'
                    void (CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *),
                                      ^
./CL/cl.h:749:26: note: to match this '('
                    void (CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *),
                         ^
./CL/cl.h:750:50: error: expected function body after function declarator
                    void *      /* user_data */) CL_API_SUFFIX__VERSION_1_1;
                                                 ^
./CL/cl.h:793:58: error: expected function body after function declarator
                        cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_1;
                                                         ^
./CL/cl.h:820:59: error: expected function body after function declarator
                         cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_1;
                                                          ^
./CL/cl.h:846:58: error: expected function body after function declarator
                        cl_event *          /* event */) CL_API_SUFFIX__VERSION_1_1;
                                                         ^
gcc -o ../../build/bin/omc-diff lex.yy.c
/opt/local/bin/clang++-mp-3.1 -pipe -O2 -arch x86_64 -Wall -DUSE_CORBA -DUSE_OMNIORB -I/opt/local/include  -c -o options.o options.cpp
13 errors generated.
make[1]: *** [omc_ocl_builtin_kernels.o] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_14576/SimulationRuntime/ParModelica/OpenCLRuntime'
make: *** [opencl_rt] Error 2

Re: openmodelica-devel macports build broken on OS X 10.6?

That is weird. It works for me on 11.4. I tried changing a file to use the OSX built-in OpenCL headers instead of the ones copied from... Windows? It should work better. Or output an error saying you don't have OpenCL headers. At which point you scream and I fix the configure script.

If you only want to apply my patch (and save time recompiling everything), see https://trac.openmodelica.org/OpenModel … set/14600.

Re: openmodelica-devel macports build broken on OS X 10.6?

Thanks for the patch. Switching to the Apple OpenCL headers did the trick. Everything seems to have compiled without issue. However, launching OMEdit.app gives the following error:

Code:


Unable to find OMEdit server, Object reference file /var/folders/../openmodelica... not created. OMEdit will close.

OMShell seems to work well though. I've noticed that the default configure flags that MacPorts uses disables paradiseo (ergo OMOptim) and OMNotebook. I noticed a warning about OMNotebook on the Mac download page, but any reason why I shouldn't have OMOptim compiled?

Re: openmodelica-devel macports build broken on OS X 10.6?

The problem is OMOptim requires paradiseo. Paradiseo requires gcc 4.4, and some of the OSX system headers are incompatible with gcc 4.4. It might be possible to circumvent this (the Linux builds forces gcc 4.4 but only for OMOptim, if it can find gcc 4.4). OMNotebook is disabled because it simply does not work satisfactory on OSX.

The OMEdit app should be using the correct omc version (I hope). I believe you could try "omc +interactiveCorba" and see if any error-messages pop up. I got this on OSX:

Code:

sakura:~ martin$ /opt/openmodelica/bin/omc +d=interactiveCorba

Created server.
Dumped Corba IOR in file: /var/folders/9m/y0z96n9j22dg43hldg3v19y0000102/T//openmodelica.martin.objid
Started the Corba ORB thread with id: 0x10e9f0000

But I don't have an OSX GUI, so I cannot test OMEdit.app.

Re: openmodelica-devel macports build broken on OS X 10.6?

Running omc as you suggested gave me the following:

Code:


XXX:~ XXX$ omc +d=interactiveCorba
Warning: Failed to set locale: ''
Created server.
Dumped Corba IOR in file: /var/folders/ta/taZOlHGXGfqAd5vYye0I6++++TI/-Tmp-//openmodelica.XXX.objid
Started the Corba ORB thread with id: 0x10af04000

It seems that this part is working, but for OMEdit is still non-functional. I've tried recompiling everything from scratch, to make sure that something didn't get broken along the way, but still no luck.

Re: openmodelica-devel macports build broken on OS X 10.6?

And OMShell works.... I believe they both use the same method of starting omc... I guess it's time for a bug report.

https://trac.openmodelica.org/OpenModelica/newticket

Set component to OMEdit and make a link to this thread and Adeel will take a closer look.

Re: openmodelica-devel macports build broken on OS X 10.6?

Thanks a lot for your help thus far. I've opened up a new ticket as you recommended. I'll post back to this thread if/when something comes along.

There are 0 guests and 0 other users also viewing this topic
You are here: