Compiling OGDF on ARM architecture

31 views
Skip to first unread message

Elvio Amparore

unread,
Apr 22, 2021, 11:17:37 AM4/22/21
to ogdf
Dear all,
    I am trying to compile OGDF on a ARM machine with clang. OGDF seems to compile and run fine, except for two minor issues:
  1. in file src/ogdf/basic/System.cpp, lines 70 and 84, I had to replace the condition:
    #ifdef __GNUC__
    with
    #if defined(__GNUC__) && ( defined(__i386__) || defined(__x86_64__) )
    since the included header cpuid.h and the function __get_cpuid() are x86-specific, and are not available on ARM machines.

  2. in cmake/compiler-specifics.cmake, line 18, I removed the 
    -march=native
    flag which is not supported by clang (the arch=native should be useless anyway, since it is the default).
Would you please consider to integrate these small changes in the source tree?
By the way, is this Google group still active? I see only old messages in the conversation list.

Best regards
--Elvio

Dagobert Smart

unread,
Apr 23, 2021, 8:21:55 AM4/23/21
to ogdf
Dear Elvio,

this mailing list is technically still in use. We also have a GitHub repository where you can submit issues/changes: https://github.com/ogdf/ogdf/ . But neither of them are very active because we currently only have few active developers and not much time.

We can definitely add the first change. With your second change, however, `include/ogdf/energybased/fast_multipole_embedder/ComplexDouble.h` does not compile correctly when `OGDF_FME_KERNEL_USE_SSE` is defined. Apparently "-march=native" is used to enable SSE3-features which are used in that code. We can guard the "-march=native" line like this:
    if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" AND NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm")
Would that be working for you? If yes, we can include the change in the next release.

Best regards,
Dagobert

Elvio Amparore

unread,
Apr 23, 2021, 11:47:43 AM4/23/21
to ogdf
Il giorno venerdì 23 aprile 2021 alle 14:21:55 UTC+2 Dagobert Smart ha scritto:
Dear Elvio,

this mailing list is technically still in use. We also have a GitHub repository where you can submit issues/changes: https://github.com/ogdf/ogdf/ . But neither of them are very active because we currently only have few active developers and not much time.

We can definitely add the first change. With your second change, however, `include/ogdf/energybased/fast_multipole_embedder/ComplexDouble.h` does not compile correctly when `OGDF_FME_KERNEL_USE_SSE` is defined. Apparently "-march=native" is used to enable SSE3-features which are used in that code. We can guard the "-march=native" line like this:
    if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" AND NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm")
Would that be working for you? If yes, we can include the change in the next release.

Yes, I confirm you that the second change allows to build properly on clang/arm.
Best regards
--Elvio
Reply all
Reply to author
Forward
0 new messages