Giter VIP home page Giter VIP logo

xpa's Introduction

Goodbye to astrophysics!

My personal aim in writing astrophysics software has been to understand practically a strange, wonderful notion of J.G. Bennett:

In our usual modes of thought we assume that being comes before doing or that being is somehow independent of action ... The truth is just the opposite. We are nothing at all, it is the action that makes us. Our being is an illusion; it is the action that is really there ... We can hardly bring ourselves to see that there are doings who be things ...

And it was A. N. Whitehead who supplied a key to understanding our creative role in a process-centered world:

... Creativity achieves its supreme task of transforming disjointed multiplicity, with its diversities in opposition, into ... unity, with its diversities in contrast ...

If I have produced anything of value, most of the credit must be given to the practical wisdom contained in these ideas. That I so often fell short is, of course, solely my responsibiity.

Eric Mandel
July 1, 2022

xpa's People

Contributors

djerius avatar emmt avatar ericmandel avatar mileslucas avatar wjoye avatar

Stargazers

 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  avatar  avatar

xpa's Issues

uintptr_t undeclared error on Fedora >= 27

Hello, when compiling xpa with TCL support in a Fedora >= 27 system, I get the following error

tcl.c: In function 'XPARec_Tcl':
tcl.c:974:58: error: 'uintptr_t' undeclared (first use in this function); did you mean 'intptr_t'?

   if( !(chan = Tcl_MakeTcpClientChannel((ClientData)(uintptr_t)xpa_cmdfd(xpa))) ){
                                                      ^~~~~~~~~
                                                       intptr_t

The compilation worked in Fedora 26.

The problem appears when compiling in the Fedora build system, that is, where the RPMS for Fedora are created. The CFLAGS hare are set to

CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables'

If I patch tcl.c to include <stdint.h>, the error goes away, but I don't know if this will work generally or only for Fedoras

unused result warnings when compiling with gcc 7.4.0

When compiling with glibc 2.27 and gcc 7.4.0 I got the following warnings (I'm showing the full compile output just to show they are the only warnings :-)

gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H xpa.c
gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H xpaio.c
gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H command.c
gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H acl.c
gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H remote.c
gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H clipboard.c
gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H port.c
gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H tcp.c
gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H client.c
client.c: In function 'XPAClientGet':
client.c:1064:2: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
  write(client->fd, tbuf, strlen(tbuf));
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
client.c:1066:7: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
       write(client->fd, *(client->bufptr), *(client->lenptr));
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
client.c:1070:2: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
  write(client->fd, tbuf, strlen(tbuf));
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
client.c:1099:7: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
       write(client->fd, *(client->bufptr), *(client->lenptr));
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
client.c: In function 'XPAClientLoopFork':
client.c:1535:5: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
     write(fd[1], &active, 1);
     ^~~~~~~~~~~~~~~~~~~~~~~~
client.c:1555:5: warning: ignoring return value of 'read', declared with attribute warn_unused_result [-Wunused-result]
     read(fd[0], &active, 1);
     ^~~~~~~~~~~~~~~~~~~~~~~
gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H word.c
gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H xalloc.c
xalloc.c: In function '_xalloc_error':
xalloc.c:43:3: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
   write(1, XALLOC_ERROR, strlen(XALLOC_ERROR));
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H find.c
find.c: In function 'ResolvePath':
find.c:191:5: warning: ignoring return value of 'getcwd', declared with attribute warn_unused_result [-Wunused-result]
     getcwd(path, MAXBUFSIZE);
     ^~~~~~~~~~~~~~~~~~~~~~~~
gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H xlaunch.c
xlaunch.c: In function 'launch_fork_exec':
xlaunch.c:223:8: warning: ignoring return value of 'dup', declared with attribute warn_unused_result [-Wunused-result]
        dup(1);
        ^~~~~~
xlaunch.c:282:2: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
  write(fd[1], &status, 4);
  ^~~~~~~~~~~~~~~~~~~~~~~~
gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H timedconn.c
gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H  tclloop.c
gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H  tcl.c
gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H  xtloop.c
gcc -c -I. -g -O2 -D_REENTRANT -fPIC -DHAVE_CONFIG_H  gtkloop.c

shared libs ignore LDFLAGS

Currently the shared library build ignores LDFLAGS. This patch will fix it

--- a/Makefile.in
+++ b/Makefile.in
@@ -182,7 +182,7 @@
 		rm -f lib$(PACKAGE).tmp/xt*.o; \
 		rm -f lib$(PACKAGE).tmp/tcl*.o; \
 		CC='$(CC)' CXX=$(CXX) \
-		./mklib -o $(PACKAGE) lib$(PACKAGE).tmp/*.o; \
+		./mklib -ldflags "$(LDFLAGS)" -o $(PACKAGE) lib$(PACKAGE).tmp/*.o; \
 		rm -rf lib$(PACKAGE).tmp)

 mingw-dll:	$(LIBOBJS)

xpamb doc mentions -store; should be -data

under OPTIONS, just after the documentation for -del, there's an example:

cat foo.fits | xpaset xpamb -store foo -info "FITS" "DS9:*" fits foo.fits

That should be

cat foo.fits | xpaset xpamb -data foo -info "FITS" "DS9:*" fits foo.fits

compiling with strict POSIX standards

It seems that the POSIX.1-2001 standard requires a different/additional header file <sys/select.h> to be included to provide the fd_set type. See for example here and here. The error when compiling with strict standard settings is

xpa-master/xpa.h:403:33: error: unknown type name 'fd_set'
int XPAAddSelect _PRx((XPA xpa, fd_set *readfdsptr));
                                ^
xpa-master/prsetup.h:27:17: note: expanded from macro '_PRx'
#define _PRx(s) s
                ^

In order to use XPA on a Linux system in a --std=c99 code, I had to use the following:

#define _XOPEN_SOURCE 600
#include <sys/select.h>
#include "xpa.h"

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.