Menu

#1610 Cannot cross-compile VICE anymore.

v3.6
open
dqh
None
Buildsystem
2021-12-30
2021-11-07
No

I just discovered that I cannot cross compile anymore VICE.
This is the message that I'm getting:

checking for native OpenMP and multiple cores... 
configure: error: cannot run test program while cross compiling
See `config.log' for more details

I did this very quick fix into the configure script for fixing the trouble:

Index: vice/configure.ac
===================================================================
--- vice/configure.ac   (revisione 41098)
+++ vice/configure.ac   (copia di lavoro)
@@ -1083,6 +1083,7 @@
               VICE_CFLAGS="$VICE_CFLAGS -fopenmp"
               VICE_CXXFLAGS="$VICE_CXXFLAGS -fopenmp"
               VICE_LDFLAGS="$VICE_LDFLAGS -fopenmp" ],
+            [ AC_MSG_RESULT(no) ],
             [ AC_MSG_RESULT(no) ])
 CFLAGS=$ORIG_CFLAGS

But probably, it is better to do it better, by adding an option --with-openmp=on/off/auto for configuring this stuff (auto will be the default selection).
What do you think?

Discussion

  • gpz

    gpz - 2021-11-07

    yes such option should be added (you might want openmp enabled even with crosscompiling, but then it shouldnt try to run test programs, obviously)

     
    • Carlo Bramini

      Carlo Bramini - 2021-11-07

      Yes, the AC_TRY_RUN() has to be executed only if the option is set to auto.
      Otherwise, have_openmp will be set directly with the vale provided into --with-openmp. This is also my idea.

       
  • gpz

    gpz - 2021-11-07
    • assigned_to: dqh
     
  • compyx

    compyx - 2021-11-08

    I'd suggest --enable-openmp=[yes|no|auto], since openmp appears to be a compiler switch/API rather than a separate library one must install. Autotools uses --with for features that require extra libraries/programs, --enable is for enabling features that don't require anything extra.

     
  • compyx

    compyx - 2021-11-08

    Looking through configure I noticed the following comment:

    Xcode ships cland [sic] without OpenMP, but it can be installed with macports / brew.

    So perhaps the switch should be --enable-openmp [default=yes], dropping the autodetect since it requires a library on MacOS that users might not be aware of. That means configuring VICE on MacOS without OpenMP installed will alert users about possibly degraded performance.

    Any thoughts on this? I personally prefer the way of least surprise, in other words: no autodetect if we can avoid it.

     
  • Querino

    Querino - 2021-11-09

    ...will alert users about possibly degraded performance.

    i don't see any performance difference in win 7?
    is this more a PoC at the moment?

     
    • dqh

      dqh - 2021-11-10

      Basically just POC at the moment. It's only used to speed up the 'Unfiltered' double size render which is simple enough for this to be easy to achieve. I'm looking at using it elsewhere, including a couple of places within resid.

      On Windows and Linux it can be expected to be available.

       
  • dqh

    dqh - 2021-11-10

    For now, in r41104 i've just relaxed it to an AC_TRY_LINK. Should fix cross compile if this was the only issue

     
  • compyx

    compyx - 2021-11-10

    Looks good to me. I see that the MacOS build instructions include installing libomp, so everything works out.

     
  • Carlo Bramini

    Carlo Bramini - 2021-11-10

    Excuse me, have you evaluated the chance to use AC_OPENMP provided by autotools?
    Since the macro provides several variables like OPENMP_CFLAGS, you could easily integrate extra configuration from the command line or integrate additional options if the platform needs them.

     
    • dqh

      dqh - 2021-11-15

      That's great, thanks for letting me know about that. Much simpler, I'll look into it.

       

Log in to post a comment.