Code Monkey home page Code Monkey logo

zpic's People

Contributors

ax3l avatar pardallio avatar ricardo-fonseca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

zpic's Issues

`em1d` fails to compile due to missing function declaration

EM1D code fails compilation:

gcc -c -Ofast -std=c99 -pedantic main.c -o main.o
main.c:58:8: error: implicit declaration of function 'report' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                if ( report ( n , sim.ndump ) ) sim_report( &sim );

Errors compiling em2d and python directories with gcc make in Ubuntu on WSL2

Dear Profesor Fonseca,

I'm using Windows Subsystem for Linux 2 (WSL2) with virtualized Ubuntu to try to avoid the problems I was running into when I tried to compile zpic in Windows natively. However, I'm getting errors in the same two directories em2d and python as shown below. This makes me think the problem isn't with the windows compiling procedure but a general problem that can also affect UNIX-like systems like Ubuntu.

landry@DESKTOP-1CC57C4:~/zpic/em2d$ make
clang -c -Ofast -std=c99 -Wall -pedantic current.c -o current.o
make: clang: Command not found
make: *** [Makefile:29: current.o] Error 127
landry@DESKTOP-1CC57C4:~/zpic/python$ make
python3 setup.py build_ext -if
running build_ext
building 'em1d' extension
gcc-8.2.0 -Wno-unused-result -Wsign-compare -fwrapv -O2 -Wall -fstack-protector-strong -Wformat -Werror=format-security -fwrapv -O2 -std=c99 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.8 -c em1d.c -o build/temp.linux-x86_64-3.8/em1d.o
unable to execute 'gcc-8.2.0': No such file or directory
error: command 'gcc-8.2.0' failed with exit status 1
make: *** [Makefile:2: all] Error 1

I also got a warning compiling em2ds, even though it looks like it worked:

landry@DESKTOP-1CC57C4:~/zpic/em2ds$ make
gcc -c -Ofast -std=c99 -pedantic charge.c -o charge.o
charge.c: In function ‘charge_init_neutral_bkg’:
charge.c:54:2: warning: pointers to arrays with different qualifiers are incompatible in ISO C [-Wpedantic]
  scalar_grid2d_init( &charge->neutral, (unsigned int *) charge ->rho.nx,
  ^~~~~~~~~~~~~~~~~~
gcc -c -Ofast -std=c99 -pedantic current.c -o current.o
gcc -c -Ofast -std=c99 -pedantic emf.c -o emf.o
gcc -c -Ofast -std=c99 -pedantic particles.c -o particles.o
gcc -c -Ofast -std=c99 -pedantic grid2d.c -o grid2d.o
gcc -c -Ofast -std=c99 -pedantic fft.c -o fft.o
gcc -c -Ofast -std=c99 -pedantic filter.c -o filter.o
gcc -c -Ofast -std=c99 -pedantic random.c -o random.o
gcc -c -Ofast -std=c99 -pedantic timer.c -o timer.o
gcc -c -Ofast -std=c99 -pedantic main.c -o main.o
gcc -c -Ofast -std=c99 -pedantic simulation.c -o simulation.o
gcc -c -Ofast -std=c99 -pedantic zdf.c -o zdf.o
gcc -Ofast -std=c99 -pedantic charge.o current.o emf.o particles.o grid2d.o fft.o filter.o random.o timer.o main.o simulation.o zdf.o -lm -o zpic

arm64 docker container support

The new Mac lineup all use M1 processors, with arm64 architecture. The zamb/zpic container only supports the amd64 arch.

The docker documentation states

In summary, running Intel-based containers on Arm-based machines should be regarded as “best effort” only. We recommend running arm64 containers on Apple Silicon machines whenever possible.

spack package

Do you think people would be interested in a spack package for zpic?
That could potentially make local installs easier.

linker error in `em1d` and `em1ds`

Running make all inside em1ds results in

gcc -c -Ofast -std=c99 -pedantic filter.c -o filter.o
gcc -c -Ofast -std=c99 -pedantic charge.c -o charge.o
gcc -c -Ofast -std=c99 -pedantic current.c -o current.o
gcc -c -Ofast -std=c99 -pedantic emf.c -o emf.o
gcc -c -Ofast -std=c99 -pedantic particles.c -o particles.o
gcc -c -Ofast -std=c99 -pedantic grid.c -o grid.o
gcc -c -Ofast -std=c99 -pedantic fft.c -o fft.o
gcc -c -Ofast -std=c99 -pedantic random.c -o random.o
gcc -c -Ofast -std=c99 -pedantic timer.c -o timer.o
gcc -c -Ofast -std=c99 -pedantic main.c -o main.o
gcc -c -Ofast -std=c99 -pedantic simulation.c -o simulation.o
gcc -c -Ofast -std=c99 -pedantic zdf.c -o zdf.o
gcc    -Ofast -std=c99 -pedantic -lm filter.o charge.o current.o emf.o particles.o grid.o fft.o random.o timer.o main.o simulation.o zdf.o -o zpic
filter.o: In function `filter_set':
filter.c:(.text+0x3f8): undefined reference to `__expf_finite'
emf.o: In function `lon_env':
emf.c:(.text+0x26b): undefined reference to `cos'
emf.o: In function `emf_add_laser':
emf.c:(.text+0x360): undefined reference to `sincosf'
emf.c:(.text+0x3f7): undefined reference to `cos'
emf.c:(.text+0x441): undefined reference to `cos'
emf.o: In function `advance_psatd':
emf.c:(.text+0x1874): undefined reference to `sincosf'
fft.o: In function `fft_init_cfg':
fft.c:(.text+0x2117): undefined reference to `sincos'
fft.o: In function `fftr_init_cfg':
fft.c:(.text+0x267b): undefined reference to `sincos'
random.o: In function `rand_norm':
random.c:(.text+0x14b): undefined reference to `__log_finite'
collect2: error: ld returned 1 exit status
Makefile:26: recipe for target 'zpic' failed
make: *** [zpic] Error 1

System: Ubuntu 18.04 LTS, gcc 7.3.0

Problems with mingw32-make (on Windows)

I'm getting errors when running mingw32-make in any directory that contains a Makefile.
It looks like the problem is primarily in the particles.h file.

em1d

C:\Users\landr\Documents\zpic-master\em1d>mingw32-make
gcc -c -Ofast -std=c99 -pedantic current.c -o current.o
gcc -c -Ofast -std=c99 -pedantic emf.c -o emf.o
gcc -c -Ofast -std=c99 -pedantic particles.c -o particles.o
In file included from particles.c:15:
particles.h:109:1: error: unknown type name 'uint64_t'; did you mean 'wint_t'?
 uint64_t spec_npush( void );
 ^~~~~~~~
 wint_t
particles.c:43:10: error: conflicting types for 'spec_npush'
 uint64_t spec_npush( void )
          ^~~~~~~~~~
In file included from particles.c:15:
particles.h:109:10: note: previous declaration of 'spec_npush' was here
 uint64_t spec_npush( void );
          ^~~~~~~~~~
mingw32-make: *** [Makefile:32: particles.o] Error 1

em2d

C:\Users\landr\Documents\zpic-master\em2d>mingw32-make
clang -c -Ofast -std=c99 -Wall -pedantic current.c -o current.o
process_begin: CreateProcess(NULL, clang -c -Ofast -std=c99 -Wall -pedantic current.c -o current.o, ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make: *** [Makefile:29: current.o] Error 2

es1d

C:\Users\landr\Documents\zpic-master\es1d>mingw32-make
gcc -Ofast -std=c99 -pedantic -c charge.c -o charge.o
gcc -Ofast -std=c99 -pedantic -c field.c -o field.o
gcc -Ofast -std=c99 -pedantic -c particles.c -o particles.o
In file included from particles.c:17:
particles.h:99:1: error: unknown type name 'uint64_t'; did you mean 'wint_t'?
 uint64_t spec_npush( void );
 ^~~~~~~~
 wint_t
particles.c:44:10: error: conflicting types for 'spec_npush'
 uint64_t spec_npush( void )
          ^~~~~~~~~~
In file included from particles.c:17:
particles.h:99:10: note: previous declaration of 'spec_npush' was here
 uint64_t spec_npush( void );
          ^~~~~~~~~~
mingw32-make: *** [Makefile:30: particles.o] Error 1

em1ds

C:\Users\landr\Documents\zpic-master\em1ds>mingw32-make
gcc -c -Ofast -std=c99 -pedantic filter.c -o filter.o
gcc -c -Ofast -std=c99 -pedantic charge.c -o charge.o
gcc -c -Ofast -std=c99 -pedantic current.c -o current.o
gcc -c -Ofast -std=c99 -pedantic emf.c -o emf.o
gcc -c -Ofast -std=c99 -pedantic particles.c -o particles.o
In file included from particles.c:17:
particles.h:102:1: error: unknown type name 'uint64_t'; did you mean 'wint_t'?
 uint64_t spec_npush( void );
 ^~~~~~~~
 wint_t
particles.c:45:10: error: conflicting types for 'spec_npush'
 uint64_t spec_npush( void )
          ^~~~~~~~~~
In file included from particles.c:17:
particles.h:102:10: note: previous declaration of 'spec_npush' was here
 uint64_t spec_npush( void );
          ^~~~~~~~~~
mingw32-make: *** [Makefile:30: particles.o] Error 1

em2ds

C:\Users\landr\Documents\zpic-master\em2ds>mingw32-make
gcc -c -Ofast -std=c99 -pedantic charge.c -o charge.o
charge.c: In function 'charge_init_neutral_bkg':
charge.c:54:2: warning: pointers to arrays with different qualifiers are incompatible in ISO C [-Wpedantic]
  scalar_grid2d_init( &charge->neutral, (unsigned int *) charge ->rho.nx,
  ^~~~~~~~~~~~~~~~~~
gcc -c -Ofast -std=c99 -pedantic current.c -o current.o
gcc -c -Ofast -std=c99 -pedantic emf.c -o emf.o
gcc -c -Ofast -std=c99 -pedantic particles.c -o particles.o
In file included from particles.c:17:
particles.h:110:1: error: unknown type name 'uint64_t'; did you mean 'wint_t'?
 uint64_t spec_npush( void );
 ^~~~~~~~
 wint_t
particles.c:44:10: error: conflicting types for 'spec_npush'
 uint64_t spec_npush( void )
          ^~~~~~~~~~
In file included from particles.c:17:
particles.h:110:10: note: previous declaration of 'spec_npush' was here
 uint64_t spec_npush( void );
          ^~~~~~~~~~
mingw32-make: *** [Makefile:30: particles.o] Error 1

python

C:\Users\landr\Documents\zpic-master\python>mingw32-make
python3 setup.py build_ext -if
Traceback (most recent call last):
  File "C:\Users\landr\Documents\zpic-master\python\setup.py", line 2, in <module>
    from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython'
mingw32-make: *** [Makefile:2: all] Error 1

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.