README_LINUX.txt (3725B)
1 README_LINUX.txt for PortMidi 2 Roger Dannenberg 3 14 Oct 2009 4 5 To make PortMidi, you need cmake and the Java SDK. 6 Go back up to the portmidi directory and type: 7 8 ccmake . 9 10 Type 'c' (configure) and then 'g' (generate). You may have 11 to manually set JAVA_INCLUDE_PATH and JAVA_JVM_LIBRARY 12 by typing 't' (toggle to advanced mode) and using the 13 editor to change the fields. You can find possible values 14 for JAVA_INCLUDE_PATH by typing "locate jni.h", and for 15 JAVA_JVM_LIBRARY by typing locate libjvm". 16 17 You also need JAVA_INCLUDE_PATH2, but this will normally 18 be set automatically after you set JAVA_INCLUDE_PATH and 19 run "configure" (type "c" to ccmake). Normally, 20 JAVA_INCLUDE_PATH2 is the linux subdirectory within 21 JAVA_INCLUDE_PATH. 22 23 Notice that the CMAKE_BUILD_TYPE can be Debug or Release. 24 Stick with Release if you are not debugging. 25 26 After successfully generating make files with ccmake, you 27 can run make: 28 29 make 30 31 The Makefile will build all test programs and the portmidi 32 library. For experimental software, 33 especially programs running from the command line, we 34 recommend using the Debug version -- it will terminate your 35 program and print a helpful message if any PortMidi 36 function returns an error code. (Released software should 37 check for error codes and handle them, but for quick, 38 non-critical projects, the automatic "print and die" 39 handling can save some work.) 40 41 THE pmdefaults PROGRAM 42 43 You should install pmdefaults. It provides a graphical interface 44 for selecting default MIDI IN and OUT devices so that you don't 45 have to build device selection interfaces into all your programs 46 and so users have a single place to set a preference. 47 48 Follow the instructions above to run ccmake, making sure that 49 CMAKE_BUILD_TYPE is Release. Run make as described above. Then: 50 51 sudo make install 52 53 This will install PortMidi libraries and the pmdefault program. 54 You must alos have the environment variable LD_LIBRARY_PATH set 55 to include /usr/local/lib (where libpmjni.so is installed). 56 57 Now, you can run pmdefault. 58 59 60 SETTING LD_LIBRARY_PATH 61 62 pmdefaults will not work unless LD_LIBRARY_PATH includes a 63 directory (normally /usr/local/lib) containing libpmjni.so, 64 installed as described above. 65 66 To set LD_LIBRARY_PATH, you might want to add this to your 67 ~/.profile (if you use the bash shell): 68 69 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib 70 export LD_LIBRARY_PATH 71 72 73 A NOTE ABOUT AMD64: 74 75 When compiling portmidi under linux on an AMD64, I had to add the -fPIC 76 flag to the gcc flags. 77 78 Reason: when trying to build John Harrison's pyPortMidi gcc bailed out 79 with this error: 80 81 ./linux/libportmidi.a(pmlinux.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC 82 ./linux/libportmidi.a: could not read symbols: Bad value 83 collect2: ld returned 1 exit status 84 error: command 'gcc' failed with exit status 1 85 86 What they said: 87 http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3 88 On certain architectures (AMD64 amongst them), shared libraries *must* 89 be "PIC-enabled". 90 91 CHANGELOG 92 93 22-jan-2010 Roger B. Dannenberg 94 Updated instructions about Java paths 95 96 14-oct-2009 Roger B. Dannenberg 97 Using CMake now for building and configuration 98 99 29-aug-2006 Roger B. Dannenberg 100 Fixed PortTime to join with time thread for clean exit. 101 102 28-aug-2006 Roger B. Dannenberg 103 Updated this documentation. 104 105 08-Jun-2004 Roger B. Dannenberg 106 Updated code to use new system abstraction. 107 108 12-Apr-2003 Roger B. Dannenberg 109 Fixed pm_test/test.c to filter clocks and active messages. 110 Integrated changes from Clemens Ladisch: 111 cleaned up pmlinuxalsa.c 112 record timestamp on sysex input 113 deallocate some resources previously left open