New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pngupdate #1535

Merged
merged 6 commits into from Sep 12, 2015

Conversation

Projects
None yet
5 participants
@dnadeau4
Contributor

dnadeau4 commented Sep 10, 2015

No description provided.

@@ -1,6 +1,6 @@
set(libcdms_source "${CMAKE_CURRENT_BINARY_DIR}/build/libcdms")
set(libcdms_install "${cdat_EXTERNALS}")
set(CONFIGURE_ARGS --srcdir=${libcdms_source}^^--enable-dap=^^--enable-drs=no^^--enable-hdf=no^^--enable-pp=yes^^--enable-ql=no^^--cache-file=/dev/null^^--prefix=${libcdms_install}^^--with-nclib=${cdat_EXTERNALS}/lib^^--with-ncinc=${cdat_EXTERNALS}/include^^--with-daplib=/lib^^--with-dapinc=/include^^--with-hdfinc=./include^^--with-hdflib=./lib^^--with-hdf5lib=${cdat_EXTERNALS}/lib^^--with-grib2lib=${cdat_EXTERNALS}/lib^^--with-jasperlib=${cdat_EXTERNALS}/lib^^--with-grib2inc=${cdat_EXTERNALS}/include^^--enable-grib2)
set(CONFIGURE_ARGS --srcdir=${libcdms_source}^^--enable-dap=^^--enable-drs=no^^--enable-hdf=no^^--enable-pp=yes^^--enable-ql=no^^--cache-file=/dev/null^^--prefix=${libcdms_install}^^--with-nclib=${cdat_EXTERNALS}/lib^^--with-ncinc=${cdat_EXTERNALS}/include^^--with-daplib=/lib^^--with-dapinc=/include^^--with-hdfinc=./include^^--with-hdflib=./lib^^--with-hdf5lib=${cdat_EXTERNALS}/lib^^--with-pnglib=/usr/X11R6/lib^^--with-grib2lib=${cdat_EXTERNALS}/lib^^--with-jasperlib=${cdat_EXTERNALS}/lib^^--with-grib2inc=${cdat_EXTERNALS}/include^^--enable-grib2)

This comment has been minimized.

@aashish24

aashish24 Sep 10, 2015

Contributor

--with-pnglib=/usr/X11R6/lib

Will not work on all systems.

This comment has been minimized.

@doutriaux1

doutriaux1 Sep 10, 2015

Member

@dnadeau4 that is probably why it fails on other systems. @aashish24 @jbeezley could we use cmake find(libpng) or similar to set this path?

This comment has been minimized.

@aashish24

aashish24 Sep 10, 2015

Contributor

Yes, using our own custom module to find PNG is the best route.

@@ -88,7 +88,7 @@ def configure (configuration_files):
os.path.join(os.environ['EXTERNALS'],'include')))
#hdf5_library_directory = norm(os.path.join(os.environ.get('HDF5LOC',os.path.join(os.environ["EXTERNALS"])), 'lib'))
cdunif_library_directories = [cdms_library_directory]
cdunif_library_directories = [cdms_library_directory,"/usr/X11R6/lib"]

This comment has been minimized.

@aashish24

aashish24 Sep 10, 2015

Contributor

Same here.. there is no /usr/X11R6 on Ubuntu for instance.

This comment has been minimized.

@doutriaux1

doutriaux1 Sep 10, 2015

Member

we can stick a if apple if you want, but it doesn't hurt.

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Sep 10, 2015

@dnadeau4 this breaks everything, looks like cdms2 does not build anymore. We need to fix this rather quickly because the libcdms update now breaks mac in master.

@@ -403,7 +403,7 @@ if(APPLE)
set(cdat_osx_arch_flag_fortran "-m${CMAKE_OSX_ARCHITECTURES_M}")
set(cdat_osx_version_flag "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
set(cdat_osx_sysroot "-isysroot ${CMAKE_OSX_SYSROOT}")
set(cdat_osx_cppflags "-I${CMAKE_OSX_SYSROOT}/usr/include ${cdat_osx_arch_flag} ${cdat_osx_version_flag} ${cdat_osx_sysroot} -pipe ")
set(cdat_osx_cppflags "-I${CMAKE_OSX_SYSROOT}/usr/include -I/usr/X11R6/include ${cdat_osx_arch_flag} ${cdat_osx_version_flag} ${cdat_osx_sysroot} -pipe ")

This comment has been minimized.

@durack1

durack1 Sep 10, 2015

Member

On a "vanilla" OS X 10.10.5 install, the include subdir doesn't exist

This comment has been minimized.

@doutriaux1

doutriaux1 Sep 10, 2015

Member

vanilla is gone, we need libpng now both for this and matplotlib.

This comment has been minimized.

@durack1

durack1 Sep 10, 2015

Member

@doutriaux1 on the wiki there is no mention of XQuartz as a required dependency, well there is but it notes UVCDAT <v1.3.x..

x11libdir=''
x11include=''
x11libdir='/usr/X11R6/lib'
x11include='/usr/X11R6/include'

This comment has been minimized.

@durack1

durack1 Sep 10, 2015

Member

On a "vanilla" OS X 10.10.5 install, the include subdir doesn't exist. .

This comment has been minimized.

@jbeezley

jbeezley Sep 10, 2015

Contributor

I believe that directory should be installed with xquartz.

lrwxr-xr-x  1 root  wheel  8 Jan 17  2015 /usr/X11R6 -> /opt/X11

This comment has been minimized.

@durack1

durack1 Sep 10, 2015

Member

@jbeezley which is not shipped in the "vanilla" OS X 10.10.5..

[durack1ml:~] durack1% ls -al /usr/
total 8
drwxr-xr-x     5 root  wheel    170 Sep  9  2014 X11
lrwxr-xr-x     1 root  wheel      3 Jan 28  2015 X11R6 -> X11

This comment has been minimized.

@jbeezley

jbeezley Sep 10, 2015

Contributor

I think xquartz will need to be a hard requirement for UV-CDAT.

This comment has been minimized.

@aashish24

aashish24 Sep 10, 2015

Contributor

@jbeezley we don't want that. we ran into multiple issues and xquartz is something that I think will go away eventually.

This comment has been minimized.

@jbeezley

jbeezley Sep 10, 2015

Contributor

I don't think there is a system libpng besides the xquartz one at least. If we detect that and compile our own libpng and the user later installs xquartz, there is a good chance it will segfault as it did before we started using the xquartz version a while back.

XQuartz is so standard these days most everybody installs it even if they don't know it. There is even a GUI dialog for installing it that you can trigger from the commandline.

This comment has been minimized.

@dnadeau4

dnadeau4 Sep 10, 2015

Contributor

We need png for g2clib 1.4.0 and I got it to work on my Mac and Ubuntu before I check in. I tried to install libpng in the EXTERNALS library but it is conflicting with the system one. libpng is now a UVCDAT requirement. What is the best approach to add it to the system? On linux we can easy get it, but on the MAC???

This comment has been minimized.

@dnadeau4

dnadeau4 Sep 10, 2015

Contributor

@doutriaux1 if we don't have png this mean that grib2 will be broken in cdms2. PNG is a requirement now for g2clib 1.4.0.

This comment has been minimized.

@dnadeau4

dnadeau4 Sep 10, 2015

Contributor

I recompiled on crunchy and this is working???? The system libpng is found, so I don't know why buildbot did not like it.

configure:4516: checking for png_error in -lpng
configure:4541: /usr/bin/gcc -o conftest -I/export/nadeau1/uvcdat/09-09-15/Externals/include -I/export/nadeau1/uvcdat/09-09-15/Externals/lib/libffi-3.1/include   -fPIC -I/export/nadeau1/uvcdat/09-09-15/Externals/include -I/export/nadeau1/uvcdat/09-09-15/Externals/lib/libffi-3.1/include    -L/export/nadeau1/uvcdat/09-09-15/Externals/lib -L/export/nadeau1/uvcdat/09-09-15/Externals/lib64  -Wl,-rpath,/export/nadeau1/uvcdat/09-09-15/Externals/lib64 -Wl,-rpath,/export/nadeau1/uvcdat/09-09-15/lib -Wl,-rpath,/export/nadeau1/uvcdat/09-09-15/Externals/lib conftest.c -lpng -L/export/nadeau1/uvcdat/09-09-15/Externals/lib -L/usr/X11R6/lib  >&5
configure:4541: $? = 0
configure:4551: result: yes

This comment has been minimized.

@aashish24

aashish24 Sep 10, 2015

Contributor

I don't think there is a system libpng besides the xquartz one at least. If we detect that and compile our own libpng and the user later installs xquartz, there is a good chance it will segfault as it did before we started using the xquartz version a while back.

@jbeezley if we compile own own, we will have it our paths and ld paths so that it will be found. The problem may happen if a user try to use another package that uses some other PNG library but that would be hard to avoid. The right way to do this is this:

  1. Find system png
  2. If found use 1)
  3. If not, build our own.
@aashish24

This comment has been minimized.

Contributor

aashish24 commented Sep 10, 2015

@doutriaux1 matplotlib should be off by default (as that's what we discussed) and therefore the xquartz should be a optional dependency. My point is that we need to keep the core dependencies as small as possible or otherwise we won't be able to attract new users.

@durack1

This comment has been minimized.

Member

durack1 commented Sep 10, 2015

@aashish24 @doutriaux1 to make a provocative comment.. Wouldn't all this dependency talk go away if a clean *.dmg installer package was generated for OS X?

Why would you bother building something if you can download a *.dmg and double click, drag into your /Applications folder and start working?

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Sep 10, 2015

ok normal test failing, but retriggering it just to make sure that I have merged @sankhesh baselines in.

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Sep 11, 2015

@aashish24 matplotlib was decided to be out back on by default at the time @sankhesh put it in.

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Sep 11, 2015

All right all good let's merge

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Sep 11, 2015

@aashish24 we need this for this release. Post release I have a branch to link against mac's native libpng. But it's clunky it needs to edit the c code because Apple changed the names of some function calls (added _cg prefix) . if you feel strongly about it we could also remove the X11 bit and buold png again. But that also leads to some issues if I recall correctly and that was why we decided to take it off. @dnadeau4 could try another branch in which you simply enable the build of libpng on Mac. That might be the best. Actually I will try it too next week if you don't beat me to it.

@aashish24

This comment has been minimized.

Contributor

aashish24 commented Sep 11, 2015

@doutriaux1 we cannot merge this as it is this line "--with-pnglib=/usr/X11R6/lib" which would not be valid on linux system. If anything we need to make sure that we guard against Linux. I understand we are under tight deadline but we should refrain from merging code that could break other systems 😢 : .

At miminum, please guard against the mac vs other system if not done so. I am okay if we link against system PNG after release. @jbeezley I found that you can install PNG via brew as well, I haven't tried it though.

@dnadeau4

This comment has been minimized.

Contributor

dnadeau4 commented Sep 11, 2015

@aashish24 "--with-pnglib=/usr/X11R6/lib" won't break anything, it will only add a -L/usr/X11R6/lib which won't be used except for MAC OS. if you want a to add a platform check that is fine too.

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Sep 11, 2015

@aashish24 I sort of agree with you. @dnadeau4 let's not add the oath here, but add it to APPLE search path in CMakeLists.txt also we could look for it on Mac and turn on the libpng if it is missing.

@aashish24

This comment has been minimized.

Contributor

aashish24 commented Sep 11, 2015

@aashish24 "--with-pnglib=/usr/X11R6/lib" won't break anything, it will only add a -L/usr/X11R6/lib which won't be used except for MAC OS. if you want a to add a platform check that is fine too.

@dnadeau4 yes, it might not break things but it would be odd to append a path that does not exists on a system. I am not 100% sure how it would work on supercomputers and some other linkers that we don't test on regular basis. I would suggest if you want to do minimum work, just check for apple and duplicate external project add code.

@aashish24

This comment has been minimized.

Contributor

aashish24 commented Sep 12, 2015

@dnadeau4 thanks..this is looking great. Post 2.4 we should search for PNG and build our own if not found. I will create a new issue for that.

aashish24 added a commit that referenced this pull request Sep 12, 2015

@aashish24 aashish24 merged commit ff196c5 into master Sep 12, 2015

3 checks passed

continuous-integration/kitware-buildbot/uvcdat-garant-linux-release/ Build done.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@aashish24 aashish24 deleted the pngupdate branch Sep 12, 2015

@dnadeau4

This comment has been minimized.

Contributor

dnadeau4 commented Sep 12, 2015

@aashish24 thanks! I am happy you merged it. We can work on a better solution for 3.0. Mac OS has libPng.dylib and @doutriaux1 did some work trying to use it. I'll look into it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment