Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017 
<== Date ==> <== Thread ==>

Subject: Re: MEDM installation instructions
From: Noboru Yamamoto <noboru.yamamoto@kek.jp>
To: Andrew Wagner <apwagner@u.washington.edu>
Cc: EPICS Tech Talk <tech-talk@aps.anl.gov>
Date: Wed, 23 Jun 2010 11:55:19 +0900
Hi Andrew,

Please look an attached python script.
I use this script to build openmotif2.2.3 library on MacOSX 10.6(Snow
Leopard).

I create 4 sub directories, build-ppc, build-i386, build-x86_64 and
build-universl in open motif directory, then put mk_univesl.py in the
build-universl directory.

In buil-universl directory, start python and in the python interpreter,run :
>>from mk_universl import *
>>setup_configure()
>>run_make()
>>main()

If everything goes well, you will have universal binary under
build-x86_64. Then run "make install" (or "sudo make install") in
./build-x86_64 directory.

You may need to run

>>run_make()
>>main()

repeatedly to build universal binary library.

I wrote this script just for me, so you might encounter rough edge.
Anyway, I build openmotif library for MacOSX 10.6 with this script and
medm with it.

> EPICS compiles with i386 (see -arch i386 above)
Set EPICS_HOST_ARCH=darwin-ppcx86 then EPICS make system creates
universal binary library.

regards,
Noboru Yamamoto

J-PARC control group
KEK,JAPAN


 (10/06/23 9:28), Andrew Wagner wrote:
> Thanks for the warning Ralph,
> 
> I think I'm almost there. I discovered that the openmotif Makefile puts your libs and headers exactly where they should be to be broadly accessible. /usr/X11R6/lib and /usr/X11R6/include . I can now almost compile MEDM. The problem is:
> 
> make -C O.darwin-x86 -f ../Makefile TOP=../../../.. T_A=darwin-x86 install
> /usr/bin/c++ -o medm  -L/Users/andrewwagner/EPICS/base-3-14-11/lib/darwin-x86 -L/Users/andrewwagner/EPICS/extensions/lib/darwin-x86 -L/usr/X11R6/lib       -arch i386     (etc ....)
> 
> ld: warning: in /usr/X11R6/lib/libXm.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
> Undefined symbols:
> 
> This is due to the fact that openmotif compiles with default gcc (i.e. i686-apple-darwin10-gcc-4.2.1) but EPICS compiles with i386 (see -arch i386 above). How do I hack the EPICS Makefiles to build something other than i386? I believe that if all -arch options are unset then it should use the default 64 bit compiler. How do I do this? Alternatively I could recompile openmotif in i386.
> 
> Cheers,
> 
> Andrew
> 
> 
> On Jun 22, 2010, at 1:40 PM, Ralph Lange wrote:
> 
>> Andrew,
>>
>> did you check the results of searching the tech-talk archives [1] for "openmotif"?
>> Have a look and then reconsider how much you want to get involved.....
>>
>> Cheers,
>> Ralph
>>
>> [1] http://www.aps.anl.gov/epics/tech-talk/index.php
>>
>>
>> On Tue 22 Jun 2010 16:30:11 Andrew Wagner wrote:
>>> Thanks Eric,
>>> Unfortunately I ran into the pitfall of attempting to install openmotif form source via http://www.openmotif.org/ . I was able to compile openmotif and install the programs but unfortunately its Makefile and the EPICS/extensions Makefile are incompatible. They seem to expect libraries to be built with different rules and put in different locations. The .h files medm needed where in openmotif-2.3.0/lib not /include and a library file libXm.a appears to never be built with the Makefile from openmotif.org<http://openmotif.org>  . I get the error:
>>> No rule to make target `/Users/andrewwagner/OpenMotif/openmotif-2.3.0/lib/libXm.a'
>>>
>>> Does anyone have experience installing openmotif from source? There must be a way to do this on a Linux box. For the time being I can just delete openmotif and reinstall from Darwin ports.
>>> Cheers,
>>> Andrew
>>>
>>>
>>>
>>> On Jun 22, 2010, at 9:16 AM, Eric Norum wrote:
>>>
>>>> I have the fink openmotif3 2.2.4-4 package installed on my OS X machine.  Seems to work well with MEDM, EDM, StripTool and SDDSplot.
>>>>
>>>> MEDM is an extension:
>>>> Download  the extensions configuration files from EPICS Extensions Config Files<http://www.aps.anl.gov/epics/extensions/configure/index.php>
>>>> Unpack the config file tarball. cd to the extensions  directory created by unpacking the tarball.  This directory will be referred to as the extensions<TOP>  from now on
>>>> Edit the configure/RELEASE file top refer to where you have EPICS base installed.
>>>> Edit the configure/os/CONFIG_SITE.darwin-x86.darwin-x86 file and set up the correct references to your X11 and Motif packages.
>>>> cd to the<TOP>  directory and run make
>>>>
>>>> Now to download and build an extension -- medm in this case:
>>>> Download the medm tarball:  MEDM 3.1.4<http://www.aps.anl.gov/epics/download/extensions/medm3_1_4.tar.gz>
>>>> cd to the<TOP>/src directory and unpack the medm tarball
>>>> cd to the<TOP>/src/medm directory and run make
>>>>
>>>>
>>>>
>>>>
>>>> On Jun 21, 2010, at 6:06 PM, Andrew Wagner wrote:
>>>>
>>>>> Hey guys,
>>>>>
>>>>> I'm new to EPICS and have compiled both EPICS base and Asyn successfully on my OS X 10.6.3 MacBook Pro. It seems that much of the driver support includes pre-made MEDM screens. Is there a good how-to manual for installing MEDM on OS X (or any os)? I've searched tech-talk and there definitely seem to be some pitfalls. For instance Motif 2.30 should be used instead of 2.32 to avoid some odd behavior. Thanks very much for the help.
>>>>>
>>>>> Andrew Wagner
>>>>>
>>>>>
>>>>
>>>> -- 
>>>> Eric Norum
>>>> eric@norum.ca<mailto:eric@norum.ca>
>>>>
>>>>
>>>>
>>>>
>>>
> 
> 

#!/bin/env python
"""
these libraries should also build as universal binaries
ld warning: in /opt/local/lib/libiconv.dylib, file is not of required architecture
ld warning: in /opt/local/lib/libz.dylib, file is not of required architecture
ld warning: in /opt/local/lib/libexpat.dylib, file is not of required architecture
"""
import os
import re
ObjectFilePattern=re.compile(".*((Mach-O)|(ar archive)).*")

def main():
    for root, dirs, files in os.walk('../build-x86_64'):
        for fl in files:
            if (isObjectFile(root,fl)):
                mkUniversal(root,fl)

def test(path='../build-x86_64'):
    for root, dirs, files in os.walk(path):
        for fl in files:
            if (isObjectFile(root,fl)):
                pass
def test_all():
    test("../build-ppc")
    test("../build-i386")
    test("../build-x86_64")

def isObjectFile(root,fl):
    cmd="file %s"%(os.path.join(root,fl))
    o=os.popen(cmd)
    out=o.readlines()
    ret=ObjectFilePattern.match(out[0])
    if (ret):
        print root,fl, out
    return ret

def runcmd(cmd):
    print cmd
    os.system(cmd)

def mkUniversal(root,fl):
    bn=os.path.basename(fl)
    path=root.split(os.sep)
    path[1]="build-i386"
    x86fn=os.path.join(os.path.join(*path),fl)
    path[1]="build-x86_64"
    x86_64fn=os.path.join(os.path.join(*path),fl)
    path[1]="build-ppc"
    ppcfn=os.path.join(os.path.join(*path),fl)

    runcmd("/usr/bin/lipo -create %s %s %s -output %s"%(ppcfn, x86fn, x86_64fn, bn))
    runcmd('mv -f %s %s'%(bn,x86_64fn))

Replies:
Re: MEDM installation instructions Andrew Wagner
References:
MEDM installation instructions Andrew Wagner
Re: MEDM installation instructions Eric Norum
Re: MEDM installation instructions Andrew Wagner
Re: MEDM installation instructions Ralph Lange
Re: MEDM installation instructions Andrew Wagner

Navigate by Date:
Prev: Re: MEDM installation instructions Andrew Wagner
Next: Re: MEDM installation instructions Andrew Wagner
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017 
Navigate by Thread:
Prev: Re: MEDM installation instructions Andrew Wagner
Next: Re: MEDM installation instructions Andrew Wagner
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·