Coder Social home page Coder Social logo

milk-org / milk-previous-cream Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adaptiveoptics-org/cfits

0.0 0.0 0.0 28.03 MB

Multi-purpose Imaging Libraries toolKit (milk)

Home Page: https://milk-org.github.io/milk/

License: GNU General Public License v3.0

Makefile 13.82% M4 46.91% HTML 0.34% C 17.99% CMake 20.95%
high-performance-computing image processing-language processing-pipelines shared-memory

milk-previous-cream's People

Contributors

a-sevin avatar nour-sf avatar oguyon avatar

Watchers

 avatar  avatar  avatar

milk-previous-cream's Issues

cmake can't find (n)curses when compiler=pgcc

Description
If compiler=pgcc (version 18.4), cmake can't find (n)curses library.
Strangely, this does not occur if compiler=gcc (version 7.2)

Fix:
Added in file /usr/local/share/cmake-3.11/Modules/FindCurses.cmake, at top of file:

set(CURSES_LIBRARY "/usr/lib/x86_64-linux-gnu/libncurses.so") 
set(CURSES_INCLUDE_PATH "/usr/include")

Not sure if this is an issue with our cmake files...

Proposed changes to data structures

IMPORTANT: I am proposing the following changes to the data structure in milk (+cacao, coffee). Please read carefully and let me know if you disagree.

[1] Remove default attribute ((packed)) for IMAGE_METADATA, IMAGE, EVENT_UI8_UI8_UI16_UI8, and EVENT_UI8_UI8_UI16_UI8.

I propose to enable these with an option specified at compile time, but have the default behavior to not pack the data.
Why ?
Code will run faster and be more portable to non gcc compilers. Compiler can do more optimization.
I ran into a nasty memory alignment bug when compiling with pgcc with -fast option which I do not yet fully understand, but clearly due to this packing. Removing the packing solved the issue.
Read this (pointed out by Frantz):
https://stackoverflow.com/questions/8568432/is-gccs-attribute-packed-pragma-pack-unsafe
and this (pointed out by Jared):
http://www.catb.org/esr/structure-packing/
Why not ?
Very small loss in memory usage efficiency.
Possible impact on low-level reading of fields in structure as pointer offsets may be compiler-optimized (note: this should be addressed by other approaches, and milk could print out pointer offsets to a file for others to read)

[2] Simplify data, and new locations for definition/declaration

data is currently a variable of type DATA (using typedef to a structure). Since we only have one instance of this DATA type variable, I propose to get rid of the typedef. I also propose to declare the data variable as extern in CLIcore.h which is already included in all source files requiring its use.

The proposed change would have in CLIcore.h:
struct DATA { ....};
extern struct DATA data;

data will be defined in CLImain.c:
struct DATA data;

.. and will no longer need to be declared in other files (part of included CLIcore.h)

[3] Implement static allocation of data.image and data.variable arrays, provide use with option to set smaller initial image and variable array sizes.

The current scheme is to have a dynamic allocation (default: 5000 instances) and grow it with reallocs when more needed. This works, but is not optimal is speed (compiler can better optimize with statically allocated arrays), and in some cases, we need to support smaller sized arrays for faster I/O.
I propose to :

  • provide compiler option for static vs. dynamic allocation of image and variable arrays
  • provide compiler option to set sizes of static arrays
  • provide run-time option to set initial size of dynamically allocated arrays

git pre-commit hooks

GIT can provide tools to check / lint the code before creating a commit. We are using it in our simulation project COMPASS and I find it very useful.
So, I have several questions regarding hooks:

  1. Do you think it's useful?
  2. If yes, which tools to you want to check:
    a. lint: removes un-useful CR, white spaces, format the code with tools like astyle, clang-format, ...
    b. static analyse with cppcheck
    c. other in mind ?

If you want, I can put it in my branch and try it before adopting it (or not)

Cheers,

Arnaud

doxygen documentation

Wondering how to cleanly integrate doxygen documentation with git workflow.
When running doxygen within a branch (dev or master), content of ./html/ directory is rewritten
This interferes with commits/push/merge
Is it possible to have html directory only part of master branch ? (this is different from git practices...)

Building on CentOS 7 VM fails with release 0.1.01 / 6ecc215

Here's what I'm seeing

/bin/sh ../libtool  --tag=CC   --mode=link gcc  -g -O2 -std=gnu11 -fopenmp   -o milk milk-CLImain.o CommandLineInterface/milk-CLIcore.o CommandLineInterface/milk-calc_bison.o CommandLineInterface/milk-calc_flex.o cudacomp/libcudacomp.la linARfilterPred/liblinarfilterpred.la psf/libpsf.la img_reduce/libimgreduce.la image_format/libimageformat.la ZernikePolyn/libzernikepolyn.la image_basic/libimagebasic.la image_filter/libimagefilter.la image_gen/libimagegen.la linopt_imtools/liblinoptimtools.la statistic/libstatistic.la info/libinfo.la fft/libfft.la kdtree/libkdtree.la COREMOD_arith/libcoremodarith.la COREMOD_memory/libcoremodmemory.la COREMOD_iofits/libcoremodiofits.la COREMOD_tools/libcoremodtools.la 00CORE/lib00core.la ImageStreamIO/libimagestreamio.la -lgsl -lgslcblas -lrt -lgomp -lfftw3 -lfftw3f -lncurses -lreadline -lcfitsio -ldl -lm  -lpthread
libtool: link: gcc -g -O2 -std=gnu11 -fopenmp -o .libs/milk milk-CLImain.o CommandLineInterface/milk-CLIcore.o CommandLineInterface/milk-calc_bison.o CommandLineInterface/milk-calc_flex.o  cudacomp/.libs/libcudacomp.so linARfilterPred/.libs/liblinarfilterpred.so psf/.libs/libpsf.so img_reduce/.libs/libimgreduce.so image_format/.libs/libimageformat.so ZernikePolyn/.libs/libzernikepolyn.so image_basic/.libs/libimagebasic.so image_filter/.libs/libimagefilter.so image_gen/.libs/libimagegen.so linopt_imtools/.libs/liblinoptimtools.so statistic/.libs/libstatistic.so info/.libs/libinfo.so fft/.libs/libfft.so kdtree/.libs/libkdtree.so COREMOD_arith/.libs/libcoremodarith.so COREMOD_memory/.libs/libcoremodmemory.so COREMOD_iofits/.libs/libcoremodiofits.so COREMOD_tools/.libs/libcoremodtools.so 00CORE/.libs/lib00core.so ImageStreamIO/.libs/libimagestreamio.so -lgsl -lgslcblas -lrt -lgomp -lfftw3 -lfftw3f -lncurses -lreadline -lcfitsio -ldl -lm -lpthread -fopenmp -Wl,-rpath -Wl,/opt/MagAOX/source/milk/lib
CommandLineInterface/milk-CLIcore.o: In function `functionparameter_CTRLscreen_cli':
/opt/MagAOX/source/milk/src/CommandLineInterface/CLIcore.c:570: undefined reference to `functionparameter_CTRLscreen'
CommandLineInterface/milk-CLIcore.o: In function `main_init':
/opt/MagAOX/source/milk/src/CommandLineInterface/CLIcore.c:1618: undefined reference to `processinfo_CTRLscreen'
/opt/MagAOX/source/milk/src/CommandLineInterface/CLIcore.c:1627: undefined reference to `streamCTRL_CTRLscreen'
COREMOD_memory/.libs/libcoremodmemory.so: undefined reference to `processinfo_WriteMessage'
COREMOD_memory/.libs/libcoremodmemory.so: undefined reference to `processinfo_exec_start'
COREMOD_memory/.libs/libcoremodmemory.so: undefined reference to `processinfo_exec_end'
COREMOD_memory/.libs/libcoremodmemory.so: undefined reference to `processinfo_cleanExit'
COREMOD_memory/.libs/libcoremodmemory.so: undefined reference to `processinfo_SIGexit'
COREMOD_memory/.libs/libcoremodmemory.so: undefined reference to `processinfo_shm_create'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:522: milk] Error 1
make[3]: Leaving directory '/opt/MagAOX/source/milk/src'
make[2]: *** [Makefile:635: all-recursive] Error 1
make[2]: Leaving directory '/opt/MagAOX/source/milk/src'
make[1]: *** [Makefile:418: all] Error 2
make[1]: Leaving directory '/opt/MagAOX/source/milk/src'
make: *** [Makefile:379: all-recursive] Error 1

Here's my build script:

git clone --recursive https://github.com/milk-org/milk milk
cd ./milk
git checkout dev
autoreconf -i
./configure
make
make install

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.