CNMAT / CNMAT-odot

Multi-paradigm Dynamic Programming
Other
115 stars 11 forks source link

Windows build and release #129

Closed adrianfreed closed 10 years ago

adrianfreed commented 10 years ago

First step is to compile with existing build system which (because it uses LLVM etc on cygwin, and because it is already on the laptop) is shortest path.

Step two is to experiment with Microsoft studio etc. We need the release to share with Vangelis and other Windows beta testers.

ilzxc commented 10 years ago

Sure thing, I'll be on this first thing tomorrow morning.

equilet commented 10 years ago

worth mentioning that we need this for the MMJSS course, preferably ASAP so that I can test for bugs before we rev materials

ilzxc commented 10 years ago

I'll test libo in VS2013 later on tonight on my machine - on the off-chance that the damn thing works, it's possible that we can update to building the whole of it in one go, which would be more desirable than wrangling GNU under Windows.

maccallum commented 10 years ago

If the MS compiler really doesn't support C99, then libo isn't going to compile. There are three things off the top of my head that aren't in C89:

Declaration of loop variables: for(int i = 0; i < 10; i++) Variable declarations that aren't at the top of a function (in C89, all variables have to be declared before anything else happens). Variable-sized arrays allocated on the stack: char foo[somevariable].

It's worth a shot to try to compile it, but if C99 really isn't supported, we should focus on cygwin/clang rather than waste our time with this.

On Jul 2, 2014, at 6:23 PM, ilya notifications@github.com wrote:

I'll test libo in VS2013 later on tonight on my machine - on the off-chance that the damn thing works, it's possible that we can update to building the whole of it in one go, which would be more desirable than wrangling GNU under Windows.

— Reply to this email directly or view it on GitHub.

ilzxc commented 10 years ago

http://blogs.msdn.com/b/vcblog/archive/2013/07/19/c99-library-support-in-visual-studio-2013.aspx is the reason I wish to try...

On Wed, Jul 2, 2014 at 6:33 PM, John MacCallum notifications@github.com wrote:

If the MS compiler really doesn't support C99, then libo isn't going to compile. There are three things off the top of my head that aren't in C89:

Declaration of loop variables: for(int i = 0; i < 10; i++) Variable declarations that aren't at the top of a function (in C89, all variables have to be declared before anything else happens). Variable-sized arrays allocated on the stack: char foo[somevariable].

It's worth a shot to try to compile it, but if C99 really isn't supported, we should focus on cygwin/clang rather than waste our time with this.

On Jul 2, 2014, at 6:23 PM, ilya notifications@github.com wrote:

I'll test libo in VS2013 later on tonight on my machine - on the off-chance that the damn thing works, it's possible that we can update to building the whole of it in one go, which would be more desirable than wrangling GNU under Windows.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/CNMAT/CNMAT-odot/issues/129#issuecomment-47857573.

LVangelis commented 10 years ago

Exciting really! I am observing your hard work silently and I am looking fw testing the new build. Please let me know when I can download it and I will do a thorough test.

All best regards

Vangelis

Vangelis Lympouridis, PhD

Visiting Scholar,

School of Cinematic Arts

University of Southern California

Senior Research Consultant, Creative Media & Behavioral Health Center

University of Southern California

http://cmbhc.usc.edu/ http://cmbhc.usc.edu

Whole Body Interaction Designer

http://www.inter-axions.com www.inter-axions.com

mailto:vangelis@lympouridis.gr vangelis@lympouridis.gr

Tel: +1 (415) 706-2638

From: Adrian Freed [mailto:notifications@github.com] Sent: Wednesday, July 02, 2014 7:25 AM To: CNMAT/CNMAT-odot Subject: [CNMAT-odot] Windows build and release (#129)

First step is to compile with existing build system which (because it uses LLVM etc on cygwin, and because it is already on the laptop) is shortest path.

Step two is to experiment with Microsoft studio etc. We need the release to share with Vangelis and other Windows beta testers.

— Reply to this email directly or view it on GitHub https://github.com/CNMAT/CNMAT-odot/issues/129 . https://github.com/notifications/beacon/4713079__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxOTg5NDMwNSwiZGF0YSI6eyJpZCI6MzYwMjU4Njd9fQ==--39b392fed0b2b044d76b69cb390f1eb0a2835b17.gif

adrianfreed commented 10 years ago

Ilya, THis quote from that blog is why I still want you to try but later (perhaps much later)! "For example, C99 supports declarations mixed with executable statements, variable length arrays, and designated initializers. The library can't add support for those things, and this announcement doesn't say that MS is adding C99 features to the C compiler."

Personally I have already committed 1 year of my professional life to debugging Microsoft software (Windows 2 at WaveFrame) and I got off the train. We have access to very good alternatives to Microsoft for everything we do. If we want to explore different compilers, the code generation quality of the Intel compilers should be a priority. The features of C99 that John uses are valuable, simplifying and expressive.

ilzxc commented 10 years ago

Adrian - I wanted to check and see if / what things are different with the VS2013 setup. And while there's still no support for stack-allocated variable-length arrays, the number of errors in VS2013 is definitely smaller than in the previous version.

I am not in favor (and won't be) of rewriting code that works. It'd be grand if we had one project where a single pull + build would rebuild everything in one step, but given the state of things that won't be happening any time soon.

The Intel Compilers is what I've been reading about recently, and this collection of articles is bananas: http://www.agner.org/optimize/blog/read.php?i=49#49

ilzxc commented 10 years ago

So the CNMAT-odot Makefile issues in Cygwin are as follows:

ilya@af ~/odot/CNMAT-odot
$ make win
make[1]: Entering directory `/home/ilya/odot/CNMAT-odot'
i686-w64-mingw32-gcc -mno-cygwin -DWIN_VERSION -DWIN_EXT_VERSION -U__STRICT_ANSI                                                 __ -U__ANSI_SOURCE -std=c99 -O3 -DNO_TRANSLATION_SUPPORT -I../max6-sdk/c74suppor                                                 t/max-includes -I../libo -I../libomax -Iinclude -c -o /home/ilya/odot/CNMAT-odot                                                 /build/Release/commonsyms.o ../max6-sdk/c74support/max-includes/common/commonsym                                                 s.c
i686-w64-mingw32-gcc -mno-cygwin -DWIN_VERSION -DWIN_EXT_VERSION -U__STRICT_ANSI                                                 __ -U__ANSI_SOURCE -std=c99 -O3 -DNO_TRANSLATION_SUPPORT -I../max6-sdk/c74suppor                                                 t/max-includes -I../libo -I../libomax -Iinclude -Io.schedule -c -o /home/ilya/od                                                 ot/CNMAT-odot/build/Release/pqops.o o.schedule/pqops.c
i686-w64-mingw32-gcc -mno-cygwin -DWIN_VERSION -DWIN_EXT_VERSION -U__STRICT_ANSI                                                 __ -U__ANSI_SOURCE -std=c99 -O3 -DNO_TRANSLATION_SUPPORT -I../max6-sdk/c74suppor                                                 t/max-includes -I../libo -I../libomax -Iinclude -c -o /home/ilya/odot/CNMAT-odot                                                 /build/Release/o.append.o o.append/o.append.c
In file included from o.append/o.append.c:33:0:
o.append/../o.prepend/o.prepend.c: In function ‘oppnd_fullPacket’:
o.append/../o.prepend/o.prepend.c:104:2: warning: assignment makes pointer from                                                  integer without a cast
i686-w64-mingw32-gcc -mno-cygwin -shared  -o /home/ilya/odot/CNMAT-odot/build/Re                                                 lease/o.append.mxe /home/ilya/odot/CNMAT-odot/build/Release/o.append.o /home/ily                                                 a/odot/CNMAT-odot/build/Release/commonsyms.o /home/ilya/odot/CNMAT-odot/build/Re                                                 lease/pqops.o -L../libomax -lomax -L../max6-sdk/c74support/max-includes -lMaxAPI                                                  -L../libo -lo
../libomax/libomax.a(omax_util.o):omax_util.c:(.text+0x1280): undefined referenc                                                 e to `_strsep'
../libomax/libomax.a(omax_util.o):omax_util.c:(.text+0x1382): undefined referenc                                                 e to `_strsep'
/usr/lib/gcc/i686-w64-mingw32/4.5.3/../../../../i686-w64-mingw32/bin/ld: ../libo                                                 max/libomax.a(omax_util.o): bad reloc address 0x24 in section `.rdata'
collect2: ld returned 1 exit status
Makefile.win.mk:67: recipe for target `/home/ilya/odot/CNMAT-odot/build/Release/                                                 o.append.mxe' failed
make[1]: *** [/home/ilya/odot/CNMAT-odot/build/Release/o.append.mxe] Error 1
make[1]: Leaving directory `/home/ilya/odot/CNMAT-odot'
Makefile:13: recipe for target `win' failed
make: *** [win] Error 2
ilzxc commented 10 years ago

And the libopd issues are as follow:

ilya@af ~/odot/libomax
$ make win

******************************************************************
*****                    BUILDING LIBOMAX                    *****
******************************************************************
ar cru libomax.a  omax_util.o  omax_class.o  omax_doc.o  omax_dict.o  omax_realtime.o

******************************************************************
*****                    BUILDING LIBOPD                     *****
******************************************************************
i686-w64-mingw32-gcc  -I../max6-sdk/c74support/max-includes  -I../max6-sdk/c74support/msp-includes -I../libo -I/usr/include -o omax_util_libopd.o -c omax_util.c
omax_util.c:29:27: fatal error: Carbon/Carbon.h: No such file or directory
compilation terminated.
Makefile:69: recipe for target `omax_util_libopd.o' failed
make: *** [omax_util_libopd.o] Error 1

The alterations I've made to the Makefile are marked in a snippet below:

MAC_SYSROOT = MacOSX10.8.sdk 
#MAC-CFLAGS = -arch i386 -arch x86_64 -O3 -funroll-loops -isysroot /Users/r/Documents/dev-lib/SDKs/$(MAC_SYSROOT) -mmacosx-version-min=10.5 -std=c99 
MAC_PATH_TO_SDK = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
MAC-CFLAGS = -arch i386 -arch x86_64 -O3 -funroll-loops -isysroot $(MAC_PATH_TO_SDK)/$(MAC_SYSROOT) -mmacosx-version-min=10.5 -std=c99 
MAC-PD-CFLAGS = $(MAC-CFLAGS) -DOMAX_PD_VERSION
WIN-CFLAGS = -O3 -funroll-loops -mno-cygwin -DWIN_VERSION -DWIN_EXT_VERSION -U__STRICT_ANSI__ -U__ANSI_SOURCE -std=c99
WIN-CFLAGS_PD = $(WIN-CFLAGS) -DOMAX_PD_VERSION # Added this line...

MAC-INCLUDES = -I$(MAX_INCLUDES) -I$(MSP_INCLUDES) -I$(PD_INCLUDES) -I../libo -F/System/Library/Frameworks -I/usr/include
WIN-INCLUDES = -I$(MAX_INCLUDES) -I$(MSP_INCLUDES) -I$(PD_INCLUDES) -I../libo -I/usr/include #added -I$(PD_INCLUDES)

all: CFLAGS += $(MAC-CFLAGS)
all: CFLAGS_PD += $(MAC-PD-CFLAGS)
all: CC = clang
all: I = $(MAC-INCLUDES)
all: libomax.a libopd.a
all: LIBTOOL = libtool -static -o libomax.a $(OMAX_OBJECTS)
all: LIBTOOL_PD = libtool -static -o libopd.a $(OPD_OBJECTS)

win: CFLAGS += $(WIN-CFLAGS)
win: CFLAGS_PD += $(WIN-PD-CFLAGS)
win: CC = i686-w64-mingw32-gcc
#win: CC = gcc
win: I = $(WIN-INCLUDES)
win: libomax.a libopd.a # removed comment symbol in front of libopd.a
win: LIBTOOL = ar cru libomax.a $(OMAX_OBJECTS)
win: LIBTOOL_PD = ar cru libopd.a $(OPD_OBJECTS) # added
ilzxc commented 10 years ago

For the full make win -i output, see https://gist.github.com/ilzxc/c54318f20eda1776436d

ilzxc commented 10 years ago

There are several Windows-related issues...

  1. o.message (and derivatives o.compose and o.display) crash Max when attempting to Delete these objects, I'll take a look at the free functions for them.
  2. o.display displays what appears to be a random fuck variable in its idle empty state. It appears to behave just fine otherwise - displays bundles and doesn't afraid of anything, but I'm not sure as to the cause of the random char - my thought is that there's some C74 bit about "empty text" initialization that I'm not calling.

o.expr.codebox appears to be fine.

ilzxc commented 10 years ago

The first of the two issues is fixed - I rearranged the cleanup routine in _free methods of Max classes so as to remove the bundle prior to calling dealloc on the actual object. I find it curious that this wasn't an issue otherwise.

I'm going to install Notepad++ on the Windows side of things (and, perhaps, Programmer's Notepad) as the current Visual Studio 2010 is expired and should be removed from this computer.

ilzxc commented 10 years ago

Done:

I'm going to start going through our patchers and examples on Windows tomorrow, which I think is wise as it helps us spot issues with both.

ilzxc commented 10 years ago

Currently, the Windows release is looking quite swell, but there are a few hanging chads:

  1. John - should we concern ourselves with building x64 externals for the MMJSS? I'll look into it a little later - but I can imagine several cases similar to the ones I've seen in Music158 where people want to use others' externals that are only available for x64 and this locks them out of using our shit.
  2. o.io.esplora hard-crashes Max on load. I've tested our objects individually and didn't manage to get a crash, so I'll be recoding the Max patch from scratch to see what's up. Note that this is without an actual device plugged into the USB port.
  3. Windows seems to be quite headstrong when it comes to recognizing serial devices, my lead for troubleshooting this is this link http://plugable.com/2011/07/04/how-to-change-the-com-port-for-a-usb-serial-adapter-on-windows-7 - pasted here for the record, but I'm on it.
ilzxc commented 10 years ago

It seems that the laptop I was working on was at fault here. While I'm still going to try to see how we would need to configure this in such a case, this is deferred until I'm done with my external updates & x64 build for Windows.

I'd like to include a Windows build with the next release, and I'd like the next release to happen by Monday, so stay tuned.

adrianfreed commented 10 years ago

I have the formula to make Esplora work in windows. You have to install Arduino.ini on Windows. THe Arduino installer does it but it would be nice eventually to have a CNMAT.ini and the associated installer so that we can tell Microsoft how to do plug and play. What are they thinking? You need to install a text file to tell windows that it can use the built in USB serial driver.

ilzxc commented 10 years ago

This is the current issue with ./make-release-archive.sh under cygwin on Windows:

ilya@af ~/odot/CNMAT-odot
$ ./make-release-archive.sh
./make-release-archive.sh: line 2: $'\r': command not found
./make-release-archive.sh: line 5: $'\r': command not found
./make-release-archive.sh: line 7: $'\r': command not found
./make-release-archive.sh: line 8: syntax error near unexpected token `$'\r''
'/make-release-archive.sh: line 8: `function git_branch()

ilya@af ~/odot/CNMAT-odot
$ bash --version
GNU bash, version 4.1.10(4)-release (i686-pc-cygwin)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
equilet commented 10 years ago

Does it seem likely that we can offer a Windows build by Monday? I could poll the class to see who's got what...

ilzxc commented 10 years ago

Yes. We have a working windows build and I'll have it by Monday.

On Jul 18, 2014, at 8:57 PM, Jeffrey Lubow notifications@github.com wrote:

Does it seem likely that we can offer a Windows build by Monday? I could poll the class to see who's got what...

— Reply to this email directly or view it on GitHub.

LVangelis commented 10 years ago

Great work! Is there something I can test Ilya? I d love to play around and see how things look and check for bugz.

Best

Vangelis

Vangelis Lympouridis, PhD

Visiting Scholar,

School of Cinematic Arts

University of Southern California

Senior Research Consultant, Creative Media & Behavioral Health Center

University of Southern California

http://cmbhc.usc.edu/ http://cmbhc.usc.edu

Whole Body Interaction Designer

http://www.inter-axions.com www.inter-axions.com

mailto:vangelis@lympouridis.gr vangelis@lympouridis.gr

Tel: +1 (415) 706-2638

From: ilya [mailto:notifications@github.com] Sent: Friday, July 18, 2014 9:18 PM To: CNMAT/CNMAT-odot Cc: LVangelis Subject: Re: [CNMAT-odot] Windows build and release (#129)

Yes. We have a working windows build and I'll have it by Monday.

On Jul 18, 2014, at 8:57 PM, Jeffrey Lubow notifications@github.com wrote:

Does it seem likely that we can offer a Windows build by Monday? I could poll the class to see who's got what...

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/CNMAT/CNMAT-odot/issues/129#issuecomment-49499196 . https://github.com/notifications/beacon/4713079__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMTM2MjcwMywiZGF0YSI6eyJpZCI6MzYwMjU4Njd9fQ==--f2bfda6658e8a252553f5d394e6e899682ebfda7.gif

equilet commented 10 years ago

vangelis,

thank you! that would REALLY help out, if you could spend some time testing the materials. especially the materials you'll find here: https://github.com/CNMAT/CNMAT-MMJSS

probably dreaming, but: do you happen to have an arduino esplora?

either way, your code will put the windows build to the test w/r/t the work you've done prior. have you been following the syntax updates?

ilzxc commented 10 years ago

Yeah, I can get a new build into your hands very late tomorrow night / early Sunday morning!

On Sat, Jul 19, 2014 at 12:39 AM, Jeffrey Lubow notifications@github.com wrote:

vangelis,

thank you! that would REALLY help out, if you could spend some time testing the materials. especially the materials you'll find here: https://github.com/CNMAT/CNMAT-MMJSS

probably dreaming, but: do you happen to have an arduino esplora?

either way, your code will put the windows build to the test w/r/t the work you've done prior. have you been able to follow the syntax updates?

— Reply to this email directly or view it on GitHub https://github.com/CNMAT/CNMAT-odot/issues/129#issuecomment-49502410.

ilzxc commented 10 years ago

The plan for the Windows release is as follows:

  1. I'll be at CNMAT very late tonight to get the latest-and-greatest build of all of the externals;
  2. I'll run through some of the examples patches and use it to review the help files (speaking of - there's only one left to do in the official release and that is o.edge~) - I'm fairly certain that all is well on that end.
  3. I'd like to get a Windows build into the hands of Jeff and Vangelis. I think that the easiest way to do this would be to send it via email.
  4. Either Sunday evening or Monday morning, we'll make the release, and I'll provide a Windows-friendly archive and we will publish the release on the CNMAT-MMJSS github.

Does this work for everyone?

equilet commented 10 years ago

It would work best for us if we could have the windows build by Sunday's meeting (4p). If there are consolidations to be made, what are they?

LVangelis commented 10 years ago

Gr8 Ilya. Thx! I followed much of the communication about the new development but if you have a doc with all major changes would be great. I rememberv reading about the syntax change in lamda functions.

Sent from my mobile device

On Jul 19, 2014, at 0:42, ilya notifications@github.com wrote:

Yeah, I can get a new build into your hands very late tomorrow night / early Sunday morning!

On Sat, Jul 19, 2014 at 12:39 AM, Jeffrey Lubow notifications@github.com wrote:

vangelis,

thank you! that would REALLY help out, if you could spend some time testing the materials. especially the materials you'll find here: https://github.com/CNMAT/CNMAT-MMJSS

probably dreaming, but: do you happen to have an arduino esplora?

either way, your code will put the windows build to the test w/r/t the work you've done prior. have you been able to follow the syntax updates?

— Reply to this email directly or view it on GitHub https://github.com/CNMAT/CNMAT-odot/issues/129#issuecomment-49502410.

— Reply to this email directly or view it on GitHub.

ilzxc commented 10 years ago

I'll write down as much as I can remember and try to construct a changelog from our commit history, but I won't be able to prioritize this until after we are set up and good to go with the summer school.

I'll definitely include examples of the new literal syntax and the expr codebox stuff.

On Jul 19, 2014, at 6:07 PM, LVangelis notifications@github.com wrote:

Gr8 Ilya. Thx! I followed much of the communication about the new development but if you have a doc with all major changes would be great. I rememberv reading about the syntax change in lamda functions.

Sent from my mobile device

On Jul 19, 2014, at 0:42, ilya notifications@github.com wrote:

Yeah, I can get a new build into your hands very late tomorrow night / early Sunday morning!

On Sat, Jul 19, 2014 at 12:39 AM, Jeffrey Lubow notifications@github.com wrote:

vangelis,

thank you! that would REALLY help out, if you could spend some time testing the materials. especially the materials you'll find here: https://github.com/CNMAT/CNMAT-MMJSS

probably dreaming, but: do you happen to have an arduino esplora?

either way, your code will put the windows build to the test w/r/t the work you've done prior. have you been able to follow the syntax updates?

— Reply to this email directly or view it on GitHub https://github.com/CNMAT/CNMAT-odot/issues/129#issuecomment-49502410.

— Reply to this email directly or view it on GitHub. — Reply to this email directly or view it on GitHub.

adrianfreed commented 10 years ago

Vangelis, please take 5 mins to run the o.demo.glossary patch in the examples folder. It is a gentle introduction to odot that introduces the current syntax.

adrianfreed commented 10 years ago

We need to test the patches Jeff will be using on the first day of class under windows and with an esplora.

ilzxc commented 10 years ago

Adrian, I can't quite remember if we got me a login on the Linux / Windows box on the second floor.

We can take care of this test tomorrow, as I won't be back to east bay for a few hours, but if I can log in, I'll give it a try tonight after building everything.

On Jul 19, 2014, at 7:49 PM, Adrian Freed notifications@github.com wrote:

We need to test the patches Jeff will be using on the first day of class under windows and with an esplora.

— Reply to this email directly or view it on GitHub.

adrianfreed commented 10 years ago

call On Jul 19, 2014, at 8:32 PM, ilya notifications@github.com wrote:

Adrian, I can't quite remember if we got me a login on the Linux / Windows box on the second floor.

We can take care of this test tomorrow, as I won't be back to east bay for a few hours, but if I can log in, I'll give it a try tonight after building everything.

On Jul 19, 2014, at 7:49 PM, Adrian Freed notifications@github.com wrote:

We need to test the patches Jeff will be using on the first day of class under windows and with an esplora.

— Reply to this email directly or view it on GitHub. — Reply to this email directly or view it on GitHub.

adrianfreed commented 10 years ago

call me tonight if the pass doesn't work for that machine

ilzxc commented 10 years ago

Thanks, will do!

On Jul 19, 2014, at 9:01 PM, Adrian Freed notifications@github.com wrote:

call me tonight if the pass doesn't work for that machine — Reply to this email directly or view it on GitHub.

LVangelis commented 10 years ago

ok. Where to get it from? Is there a folder for the compiled windows release?

LVangelis commented 10 years ago

no worries, got it.

LVangelis commented 10 years ago

missing a bunch! back to my original question: Is there a folder for the compiled windows release?

ilzxc commented 10 years ago

One second - I'm at CNMAT and I'm putting together a release package.

On Sun, Jul 20, 2014 at 12:35 AM, LVangelis notifications@github.com wrote:

missing a bunch! back to my original question: Is there a folder for the compiled windows release?

— Reply to this email directly or view it on GitHub https://github.com/CNMAT/CNMAT-odot/issues/129#issuecomment-49539533.

ilzxc commented 10 years ago

The temporary solution to packaging on Windows is as follows:

Since Windows does not provide adequate support for creating archives from command line, use Windows Explorer to create the zip file:

Alternatively, you may try to run make-release-archive.sh in cygwin, instead of the above steps. MAKE SURE TO RUN make-win-release.bat before running make-release-archive.sh to make sure that externals end up in the right folders.

I will remove this message once these steps are no longer necessary.