Recipe to install Tango 9 from source on MacOS X high Sierra

@Reynald,
Ok, thanks.
This is a "background task" I work on from time to time. I already applied a couple of workaround related to (my old friend) log4tango. The associated config.h doesn't seem to be properly generated under macOS (e.g. LOG4TANGO_HAVE_THREADING is not defined). I'm now facing trickier errors (see attached file for details). Anyway, count on me to report any info that could make sense for you guys.

BTW, could you tell a word about the cmake option "USE_PCH"?

EDIT: the reported errors are related to a tango-9-lts compilation attempt using the following compiler config :
Configured with: –prefix=/Library/Developer/CommandLineTools/usr –with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.59)
Target: x86_64-apple-darwin19.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Edited 4 weeks ago
Thanks Nicolas for trying to compile on Mac.
I don't have one to test.

There is an issue dedicated to that on cppTango: https://github.com/tango-controls/cppTango/issues/705

Michal created a new issue this morning to use standard threads in log4tango: https://github.com/tango-controls/cppTango/issues/712
When this issue will be fixed, you will no longer have to deal with the LOG4TANGO_HAVE_THREADING issue.

nleclercq
BTW, could you tell a word about the cmake option "USE_PCH"?

Set USE_PCH to ON if you want to use precompiled headers during the compilation.
This reduces greatly the compilation time.

This feature was introduced by Michal Liszcz in https://github.com/tango-controls/cppTango/pull/526
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Until we fix this deprecation errors, can you try to compile with this compiler option (if it exists in your case)?

-Wno-error=deprecated-declarations

Edit: Sorry. These were already warnings in your case, Nicolas it seems.
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Edited 4 weeks ago
Nicolas for the error reported in your attached file, I think it has been fixed by Giacomo in
https://github.com/tango-controls/cppTango/pull/711/files

Please have a look at the change in cppapi/client/lockthread.h file

This is not yet in tango-9-lts branch.

Could you please try compiling using this branch (the one from cppTango#711 PR):
https://github.com/bourtemb/cppTango/tree/delleceste-openbsd-fix-706
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Hey Reynald,
Bingo! The specified branch (ie. delleceste…) compiles smoothly under macOS 10.15.4 using clang 11.0.3 & cmake. Thanks.
Giacomo did a great job. The associated binary distribution can be downloaded from the provided link (see below).
The test suite also compiles without any problem. I tried to run it be most tests failed. I certainly don't have the required env. to run the test suite properly. Any doc somewhere?

>Download cppTango for macOS 10.15.4<.
Edited 4 weeks ago
@Reynald,

I managed to compile [1] and run the tango DB for macOS but I had a problem creating the tables properly using the provided script (i.e. …/share/tango/db/create_db.sh). Consequently, the database fails at startup. At least, I can confirm that, from a binary point of view, everything is ok and ready to run (no crash or whatever so far) [2].
I'm using mysql 8.0.19 (installed using brew) and I had the following error while trying to setup de tango-db tables (create_db.sh):
ERROR 1071 (42000) at line 257 in file: 'create_db_tables.sql': Specified key was too long; max key length is 1000 bytes

This prevents the "hist" tables from being created. Is this a known issue? The TangoDatabase git page makes reference to a "tango_create.sql" script that doesn't seem to be present in the git repository. Did I missed something?

EDIT: I brewed mariadb and everything works fine. The mariadb part of the tangodb is ok and the DatabaseDS is up and running.

[1] I had to insert using namespace std; right after the #include directives in update_starter.h and to switch from my_bool to bool in DatabaseUtils.cpp (my_bool is deprecated in mysql >= 8). Note that this might be purely mysql related (no such mod. required with mariadb?). I also had to (manually) remove the following linker options (from ./build/CMakefiles/Databaseds.dir/link.txt): -Wl,-z,now -pie (-z generated an error, -pie is unused).

[2] An export DYLD_LIBRARY_PATH=$IP/lib:$IP/bin is required in order to make DatabaseDS start properly - IP being the path to the tango installation directory.
Edited 4 weeks ago
Hi Reynald,

I finally have the Databaseds and a TangoTest instance running under macOS (see attached screenshot).

The Java part is a hack of a Tango-9.2.2 installation I have on a virtual machine.
Here are the main things I've done to make it run on macOS:
- install Oracle JDK (14.0.1)
- download jboss-rmi-api_1.0_spec-1.0.6.Final.jar, move it to share/java and add the jar the CLASSPATH in the Astor, Jive and LogViewer shell scripts (got some NoClassDefFoundError: javax/rmi/CORBA/Stub)
- hardcode DISPLAY=0:0 in the Astor and Pogo shell scripts (quick & dirty hack)
- change the Tango installation path in the shell scripts to /Users/nicolas/tango (quick & dirty hack)

Here is the resulting package.
Edited 4 weeks ago
Nice work Nicolas!
Hey Thomas,
Thanks but everything was almost straightforward after Giacomo's mods on the kernel.
I'm glad to be able to maintain a link with the community smile
Cheers.
N.
BTW, I spent some time trying to run the test suite. Docker has a "special" implementation under macOS [1] and the Tango scripts don't work out of the box. My main problem is to be able to reach the database instance running into the tango-cs container. This article might be a good starting point to find a workaround. Will see that later…

"This is because on macOS the docker binary is only a client and you cannot use it to run the docker daemon, because Docker daemon uses Linux-specific kernel features, therefore you can’t run Docker natively in OS X. So you have to install docker-machine in order to create VM and attach to it". See here and there for details

EDIT1: IHMO, we need to be able to bind the database process to all network interfaces (inside the container) in order to be able to reach it from macOS. I opened an issue on GitHub.

EDIT2: Thanks to Michal Liszcz, I discovered that I wasn't passing the port forwarding option (i.e. -p 10000:10000) in the right order to the docker run command.
Edited 4 weeks ago
 
Register or login to create to post a reply.