Error building emulator on mac os X

More
03 Feb 2013 21:55 #5976 by Pixel166
Error building emulator on mac os X was created by Pixel166
Hi,

I'm trying to build the emulator on mac os X, and I have this error :
+ Compiling 'target/common_emu/fltk.cpp'
target/common_emu/fltk.cpp: In function ‘void CLOCK_Init()’:
target/common_emu/fltk.cpp:461: error: ‘CLOCK_REALTIME’ was not declared in this scope
target/common_emu/fltk.cpp:461: error: ‘timer_create’ was not declared in this scope
target/common_emu/fltk.cpp:466: error: aggregate ‘itimerspec in’ has incomplete type and cannot be defined
target/common_emu/fltk.cpp:466: error: aggregate ‘itimerspec out’ has incomplete type and cannot be defined
target/common_emu/fltk.cpp:472: error: ‘timer_settime’ was not declared in this scope
make: *** [objs/emu_devo8/fltk.o] Error 1

I've search on Google, on the forum, without finding any solution.
I know the cross compiling environnement doesn't help for the emulator, but I just want to say that I successfully compile (on mac os X) the devo6 dfu file

Any idea to help me ?


Thx

Please Log in or Create an account to join the conversation.

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
04 Feb 2013 07:43 #5982 by rbe2012
Replied by rbe2012 on topic Error building emulator on mac os X
I am not sure but might it be necessary to give the parameter "make TARGET=emu_devo8 WINDOWS=1" on MAC also? If not: which version (commit) did you compile?

Please Log in or Create an account to join the conversation.

More
04 Feb 2013 08:10 #5983 by Pixel166
Replied by Pixel166 on topic Error building emulator on mac os X
I will try this this evening, but I'm not sure it will end up in a good compilation, because if I understand correctly the Makefile, here is the code that uses WINDOWS=1
ifdef WINDOWS
    #CROSS=i586-mingw32msvc-
    FLTK_DIR = /usr/local
    ifdef CROSS
        FLTK_DIR = /opt/fltk-w32
        PORTAUDIO_DIR = /opt/portaudio-w32
        LFLAGS += -mno-cygwin
        CFLAGS += -mno-cygwin
    endif
    LFLAGS := -L$(FLTK_DIR)/lib -L$(PORTAUDIO_DIR)/lib $(LFLAGS) -lole32 -luuid -lcomctl32 -lwsock32 -lgdi32 -lcomdlg32 -lportaudio
    CFLAGS += -I$(FLTK_DIR)/include -I$(PORTAUDIO_DIR)/include -DWIN32
    EXEEXT = exe
    ODIREXT = -w32
else
    LFLAGS := $(LFLAGS) -lrt
    ifndef SOUND
        CFLAGS += -DNO_SOUND
    else
        LFLAGS := $(LFLAGS) -lportaudio
    endif
endif


It seems it won't help too much for my problem, but I will try it.. as I haven't any other solution for now.

About the version (commit), I try with a lot of them (even the last one), but the code where it makes an error don't change accross all the versions, so the error is still there ;)

Please Log in or Create an account to join the conversation.

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
04 Feb 2013 09:22 #5984 by rbe2012
Replied by rbe2012 on topic Error building emulator on mac os X
I admin I am not a specialist concernign Makefiles, but the emulater is made esp. for Windows - so the WINDOWS=1-part will integrate some necessary things.
If I compile the emulator (on Windows XP) without this argument, I also get errors (file not found).
+ Compiling 'target/common_emu/fltk.cpp'
target/common_emu/fltk.cpp:28:19: schwerwiegender Fehler: FL/Fl.H: No such file or directory
Kompilierung beendet.
make: *** [objs/emu_devo8/fltk.o] Error 1

Please Log in or Create an account to join the conversation.

More
04 Feb 2013 12:10 #5994 by RandMental
Replied by RandMental on topic Error building emulator on mac os X
Hi Pixel

May I ask why you want to build the emulator on a Mac? Even if you are succsfull by crosscompiling it on a MAc for Windows, you will need to copy the .exe file to a Windows PC to run it.

Without WINDOWS=1, you cross compile for the STM32 processors in the Devo TX

Adding WINDOWS=1 you compile for Windows for a Intel 586 processor, and the Windows operating system.

Please Log in or Create an account to join the conversation.

More
04 Feb 2013 12:37 #5995 by Pixel166
Replied by Pixel166 on topic Error building emulator on mac os X
Hi RandMental,

I want to compile the emulator on my Mac, because I own a Mac, and don't have Windows. So I don't want a cross-compilation for windows, but I want a mac executable, to be launched on mac OS.
In my first most, I say I successfully compile the devo6 dfu file (with the cross compilation environnement), not the emulator ;)

I have an Ubuntu at work, and I don't need the WINDOWS=1 to compile the emulator.

Please Log in or Create an account to join the conversation.

More
04 Feb 2013 13:48 #5997 by PhracturedBlue
Replied by PhracturedBlue on topic Error building emulator on mac os X
Well, we have 2 timer systems available:
1) A unix compliant one using signals and timers
2) A windows specific implementation because Windows isn't POSIX compliant

So you definitely do not want to use WINDOWS=1 (unless you compile with and run in Wine)
But MacOSX should be POSIX compliant, so the normal build should work.
Try adding:
#include <sys/time.h>
near the other includes and see if that helps.
you might also do:
find /usr/include -name "*.h" | xargs grep CLOCK_REALTIME
To see which file it is included from.

Please Log in or Create an account to join the conversation.

More
04 Feb 2013 13:53 #5998 by FDR
Replied by FDR on topic Error building emulator on mac os X

PhracturedBlue wrote: Well, we have 2 timer systems available:
1) A unix compliant one using signals and timers
2) A windows specific implementation because Windows isn't POSIX compliant


Could this difference cause the emulator's sound issue on Windows:
www.deviationtx.com/forum/7-development/...r-s-sounds-are-false

Please Log in or Create an account to join the conversation.

More
04 Feb 2013 16:45 #6005 by PhracturedBlue
Replied by PhracturedBlue on topic Error building emulator on mac os X
It is unlikely this would affect sound. the sound code in the emulator is completely unrelated to the timer code in the emulator (though on the actual TX they are tightly related)

Please Log in or Create an account to join the conversation.

More
04 Feb 2013 17:07 #6007 by Pixel166
Replied by Pixel166 on topic Error building emulator on mac os X
find /usr/include -name "*.h" | xargs grep CLOCK_REALTIME

returns nothing.

find /usr/include -name "*.h" | xargs grep timer_t

return nothing.

After some searchs with Google, it seems mac os uses BSD time instead of POSIX time :-(

Please Log in or Create an account to join the conversation.

More
05 Feb 2013 13:51 #6051 by PhracturedBlue
Replied by PhracturedBlue on topic Error building emulator on mac os X
It is nice that 'POSIX' doesn't actually mean anything here :(

It looks like you can use setitimer

here is a setitimer implementation for you:
#include <sys/time.h>
void CLOCK_Init()
{
    timer_callback = NULL;
    signal(SIGALRM, _ALARMhandler);
    struct itimerval in;
    in.it_value.tv_usec = 100 * 1000; //100msec
    in.it_value.tv_sec = 0;
    in.it_interval.tv_usec = 1000; //1msec
    in.it_interval.tv_sec = 0;
    setitimer(ITIMER_REAL, &in, NULL);
}

replace the code in fltk.cpp with that.
If it works let me know. It seems to be ok on Linux too so I can just make the change.

Please Log in or Create an account to join the conversation.

More
05 Feb 2013 20:17 #6062 by Pixel166
Replied by Pixel166 on topic Error building emulator on mac os X
It's nearly good.
The compilation passed this previous error, but now, I have an error with 32b/64b libraries (as I understand)
Undefined symbols for architecture x86_64:
  "_objc_msgSendSuper2", referenced from:
      -[FLWindow initWithFl_W:contentRect:styleMask:] in libfltk.a(Fl_cocoa.o)
      -[FLView init] in libfltk.a(Fl_cocoa.o)

... CUT ...

  "_CGRectUnion", referenced from:
      Fl_Graphics_Driver::clip_box(int, int, int, int, int&, int&, int&, int&)in libfltk.a(fl_rect.o)
  "_CGRectEqualToRect", referenced from:
      Fl_Graphics_Driver::clip_box(int, int, int, int, int&, int&, int&, int&)in libfltk.a(fl_rect.o)
  "_CGContextAddArc", referenced from:
      Fl_Graphics_Driver::circle(double, double, double)in libfltk.a(fl_vertex.o)
      Fl_Graphics_Driver::arc(int, int, int, int, double, double)in libfltk.a(fl_arci.o)
      Fl_Graphics_Driver::pie(int, int, int, int, double, double)in libfltk.a(fl_arci.o)
  "_CGGetActiveDisplayList", referenced from:
      screen_init()      in libfltk.a(screen_xywh.o)
  "_CGDisplayBounds", referenced from:
      screen_init()      in libfltk.a(screen_xywh.o)
  "_CGDisplayScreenSize", referenced from:
      screen_init()      in libfltk.a(screen_xywh.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [emu_devo8.elf] Error 1

The error seems to be a bad version of libfltk.a, but if I check, it's an x86_64 version. I don't understant

Please Log in or Create an account to join the conversation.

More
05 Feb 2013 21:02 #6064 by PhracturedBlue
Replied by PhracturedBlue on topic Error building emulator on mac os X
I'm not sure how to help you with that. I'd agree that your libfltk does not seem tobe compatible with the rest of your system though.
You can try building it yourself, it is reasonably easy to do.

Please Log in or Create an account to join the conversation.

More
12 May 2013 22:57 #9903 by vanwadiver
Replied by vanwadiver on topic Error building emulator on mac os X
It looks like it's been a while since this topic was last addressed... Were you able to build the emulator for the MAC OSX environment?

I'd be interested in any tips on how you succeeded in building it, if possible.

Thanks..

Please Log in or Create an account to join the conversation.

More
13 May 2013 07:05 #9916 by Pixel166
Replied by Pixel166 on topic Error building emulator on mac os X
Hi,

No, I can't build the emulator on mac os X. But to be honnest, I give up very little time after the last post of this topic ;)

Please Log in or Create an account to join the conversation.

More
13 May 2013 13:08 #9921 by vanwadiver
Replied by vanwadiver on topic Error building emulator on mac os X
Ah well... perhaps I'll give it a try someday if I have some spare time....

Thanks!

Please Log in or Create an account to join the conversation.

More
04 Sep 2015 20:04 #37448 by Lyndros
Replied by Lyndros on topic Error building emulator on mac os X
nobody succeed on that? I hate using the virtual machine for development...

Please Log in or Create an account to join the conversation.

More
05 Sep 2015 00:50 #37454 by mwm
Replied by mwm on topic Error building emulator on mac os X
Well, that last post was 2+ years ago. You might give it another try, as my tweaks to the Makefiles so I can build on my BSD boxes have been merged.

One thing you'll want to do is create a bin specifically for building deviation firmware and emulators. The makes fail if cc isn't gcc like it is on FreeBSD, and OS X seems to do the same.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
05 Sep 2015 09:34 #37465 by Lyndros
Replied by Lyndros on topic Error building emulator on mac os X
I tried with the script supplied and everything some of the links include in the build-osx.sh are dead I replace them for working ones.
On the other hand it looks like the 2011 version of portaudio it is a nightmare to compile with MacOS SDK 10.10 anyhow I downloaded the latest stable portaudio and compile it ... but now another nightmare ... so I will keep going with my virtual machine :-(

On the other hand, stupid question I fixed some typos in the spanish translation but I can not create pull request to deviation main repo, any clue?

Please Log in or Create an account to join the conversation.

More
05 Sep 2015 14:55 #37466 by mwm
Replied by mwm on topic Error building emulator on mac os X
I answered your mail on bitbucket as well, but doing things here is better as others can help so you might get an answer faster, and then everyone can see the answer.

What are you doing, and what's going wrong? The more detail, the better. With that, we might be able to sort out what's wrong.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

Time to create page: 0.088 seconds
Powered by Kunena Forum